LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_winspool.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 1184 7700 15.4 %
Date: 2021-09-23 10:06:22 Functions: 39 252 15.5 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_winspool.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_misc.h"
       7             : #include "librpc/gen_ndr/ndr_security.h"
       8             : #include "librpc/gen_ndr/ndr_winreg.h"
       9             : #include "librpc/gen_ndr/ndr_spoolss.h"
      10           0 : static enum ndr_err_code ndr_push_winspool_NOTIFY_REPLY_CONTAINER(struct ndr_push *ndr, int ndr_flags, const struct winspool_NOTIFY_REPLY_CONTAINER *r)
      11             : {
      12           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      13           0 :         if (ndr_flags & NDR_SCALARS) {
      14           0 :                 NDR_CHECK(ndr_push_align(ndr, 5));
      15           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pInfo));
      16           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
      17             :         }
      18           0 :         if (ndr_flags & NDR_BUFFERS) {
      19           0 :                 if (r->pInfo) {
      20           0 :                         NDR_CHECK(ndr_push_spoolss_NotifyInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pInfo));
      21             :                 }
      22             :         }
      23           0 :         return NDR_ERR_SUCCESS;
      24             : }
      25             : 
      26           0 : static enum ndr_err_code ndr_pull_winspool_NOTIFY_REPLY_CONTAINER(struct ndr_pull *ndr, int ndr_flags, struct winspool_NOTIFY_REPLY_CONTAINER *r)
      27             : {
      28             :         uint32_t _ptr_pInfo;
      29           0 :         TALLOC_CTX *_mem_save_pInfo_0 = NULL;
      30           0 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      31           0 :         if (ndr_flags & NDR_SCALARS) {
      32           0 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
      33           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pInfo));
      34           0 :                 if (_ptr_pInfo) {
      35           0 :                         NDR_PULL_ALLOC(ndr, r->pInfo);
      36             :                 } else {
      37           0 :                         r->pInfo = NULL;
      38             :                 }
      39           0 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
      40             :         }
      41           0 :         if (ndr_flags & NDR_BUFFERS) {
      42           0 :                 if (r->pInfo) {
      43           0 :                         _mem_save_pInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
      44           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->pInfo, 0);
      45           0 :                         NDR_CHECK(ndr_pull_spoolss_NotifyInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->pInfo));
      46           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pInfo_0, 0);
      47             :                 }
      48             :         }
      49           0 :         return NDR_ERR_SUCCESS;
      50             : }
      51             : 
      52           0 : _PUBLIC_ void ndr_print_winspool_NOTIFY_REPLY_CONTAINER(struct ndr_print *ndr, const char *name, const struct winspool_NOTIFY_REPLY_CONTAINER *r)
      53             : {
      54           0 :         ndr_print_struct(ndr, name, "winspool_NOTIFY_REPLY_CONTAINER");
      55           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
      56           0 :         ndr->depth++;
      57           0 :         ndr_print_ptr(ndr, "pInfo", r->pInfo);
      58           0 :         ndr->depth++;
      59           0 :         if (r->pInfo) {
      60           0 :                 ndr_print_spoolss_NotifyInfo(ndr, "pInfo", r->pInfo);
      61             :         }
      62           0 :         ndr->depth--;
      63           0 :         ndr->depth--;
      64             : }
      65             : 
      66           0 : static enum ndr_err_code ndr_push_winspool_NOTIFY_OPTIONS_CONTAINER(struct ndr_push *ndr, int ndr_flags, const struct winspool_NOTIFY_OPTIONS_CONTAINER *r)
      67             : {
      68           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      69           0 :         if (ndr_flags & NDR_SCALARS) {
      70           0 :                 NDR_CHECK(ndr_push_align(ndr, 5));
      71           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->pOptions));
      72           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
      73             :         }
      74           0 :         if (ndr_flags & NDR_BUFFERS) {
      75           0 :                 if (r->pOptions) {
      76           0 :                         NDR_CHECK(ndr_push_spoolss_NotifyOption(ndr, NDR_SCALARS|NDR_BUFFERS, r->pOptions));
      77             :                 }
      78             :         }
      79           0 :         return NDR_ERR_SUCCESS;
      80             : }
      81             : 
      82           4 : static enum ndr_err_code ndr_pull_winspool_NOTIFY_OPTIONS_CONTAINER(struct ndr_pull *ndr, int ndr_flags, struct winspool_NOTIFY_OPTIONS_CONTAINER *r)
      83             : {
      84             :         uint32_t _ptr_pOptions;
      85           4 :         TALLOC_CTX *_mem_save_pOptions_0 = NULL;
      86           4 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      87           4 :         if (ndr_flags & NDR_SCALARS) {
      88           2 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
      89           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pOptions));
      90           2 :                 if (_ptr_pOptions) {
      91           2 :                         NDR_PULL_ALLOC(ndr, r->pOptions);
      92             :                 } else {
      93           0 :                         r->pOptions = NULL;
      94             :                 }
      95           2 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
      96             :         }
      97           4 :         if (ndr_flags & NDR_BUFFERS) {
      98           2 :                 if (r->pOptions) {
      99           2 :                         _mem_save_pOptions_0 = NDR_PULL_GET_MEM_CTX(ndr);
     100           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->pOptions, 0);
     101           2 :                         NDR_CHECK(ndr_pull_spoolss_NotifyOption(ndr, NDR_SCALARS|NDR_BUFFERS, r->pOptions));
     102           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pOptions_0, 0);
     103             :                 }
     104             :         }
     105           0 :         return NDR_ERR_SUCCESS;
     106             : }
     107             : 
     108           2 : _PUBLIC_ void ndr_print_winspool_NOTIFY_OPTIONS_CONTAINER(struct ndr_print *ndr, const char *name, const struct winspool_NOTIFY_OPTIONS_CONTAINER *r)
     109             : {
     110           2 :         ndr_print_struct(ndr, name, "winspool_NOTIFY_OPTIONS_CONTAINER");
     111           2 :         if (r == NULL) { ndr_print_null(ndr); return; }
     112           2 :         ndr->depth++;
     113           2 :         ndr_print_ptr(ndr, "pOptions", r->pOptions);
     114           2 :         ndr->depth++;
     115           2 :         if (r->pOptions) {
     116           2 :                 ndr_print_spoolss_NotifyOption(ndr, "pOptions", r->pOptions);
     117             :         }
     118           2 :         ndr->depth--;
     119           2 :         ndr->depth--;
     120             : }
     121             : 
     122           0 : static enum ndr_err_code ndr_push_winspool_PrintPropertyType(struct ndr_push *ndr, int ndr_flags, enum winspool_PrintPropertyType r)
     123             : {
     124           0 :         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
     125           0 :         return NDR_ERR_SUCCESS;
     126             : }
     127             : 
     128           0 : static enum ndr_err_code ndr_pull_winspool_PrintPropertyType(struct ndr_pull *ndr, int ndr_flags, enum winspool_PrintPropertyType *r)
     129             : {
     130             :         uint16_t v;
     131           8 :         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
     132           8 :         *r = v;
     133           0 :         return NDR_ERR_SUCCESS;
     134             : }
     135             : 
     136           8 : _PUBLIC_ void ndr_print_winspool_PrintPropertyType(struct ndr_print *ndr, const char *name, enum winspool_PrintPropertyType r)
     137             : {
     138           8 :         const char *val = NULL;
     139             : 
     140           8 :         switch (r) {
     141           0 :                 case winspool_PropertyTypeString: val = "winspool_PropertyTypeString"; break;
     142           6 :                 case winspool_PropertyTypeInt32: val = "winspool_PropertyTypeInt32"; break;
     143           0 :                 case winspool_PropertyTypeInt64: val = "winspool_PropertyTypeInt64"; break;
     144           0 :                 case winspool_PropertyTypeByte: val = "winspool_PropertyTypeByte"; break;
     145           0 :                 case winspool_PropertyTypeTime: val = "winspool_PropertyTypeTime"; break;
     146           0 :                 case winspool_PropertyTypeDevMode: val = "winspool_PropertyTypeDevMode"; break;
     147           0 :                 case winspool_PropertyTypeSD: val = "winspool_PropertyTypeSD"; break;
     148           0 :                 case winspool_PropertyTypeNotificationReply: val = "winspool_PropertyTypeNotificationReply"; break;
     149           2 :                 case winspool_PropertyTypeNotificationOptions: val = "winspool_PropertyTypeNotificationOptions"; break;
     150             :         }
     151           8 :         ndr_print_enum(ndr, name, "ENUM", val, r);
     152           8 : }
     153             : 
     154           0 : static enum ndr_err_code ndr_push_winspool_PrintPropertyValueUnion(struct ndr_push *ndr, int ndr_flags, const union winspool_PrintPropertyValueUnion *r)
     155             : {
     156             :         uint32_t level;
     157           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     158           0 :         if (ndr_flags & NDR_SCALARS) {
     159             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     160           0 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     161           0 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     162           0 :                 NDR_CHECK(ndr_push_winspool_PrintPropertyType(ndr, NDR_SCALARS, level));
     163             :                 /* ms_union is always aligned to the largest union arm*/
     164           0 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     165           0 :                 switch (level) {
     166           0 :                         case winspool_PropertyTypeString: {
     167           0 :                                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->propertyString));
     168           0 :                         break; }
     169             : 
     170           0 :                         case winspool_PropertyTypeInt32: {
     171           0 :                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->propertyInt32));
     172           0 :                         break; }
     173             : 
     174           0 :                         case winspool_PropertyTypeInt64: {
     175           0 :                                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->propertyInt64));
     176           0 :                         break; }
     177             : 
     178           0 :                         case winspool_PropertyTypeByte: {
     179           0 :                                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->propertyByte));
     180           0 :                         break; }
     181             : 
     182           0 :                         case winspool_PropertyTypeTime: {
     183           0 :                                 NDR_CHECK(ndr_push_spoolss_TimeCtr(ndr, NDR_SCALARS, &r->propertyTimeContainer));
     184           0 :                         break; }
     185             : 
     186           0 :                         case winspool_PropertyTypeDevMode: {
     187           0 :                                 NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS, &r->propertyDevModeContainer));
     188           0 :                         break; }
     189             : 
     190           0 :                         case winspool_PropertyTypeSD: {
     191           0 :                                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS, &r->propertySDContainer));
     192           0 :                         break; }
     193             : 
     194           0 :                         case winspool_PropertyTypeNotificationReply: {
     195           0 :                                 NDR_CHECK(ndr_push_winspool_NOTIFY_REPLY_CONTAINER(ndr, NDR_SCALARS, &r->propertyReplyContainer));
     196           0 :                         break; }
     197             : 
     198           0 :                         case winspool_PropertyTypeNotificationOptions: {
     199           0 :                                 NDR_CHECK(ndr_push_winspool_NOTIFY_OPTIONS_CONTAINER(ndr, NDR_SCALARS, &r->propertyOptionsContainer));
     200           0 :                         break; }
     201             : 
     202           0 :                         default:
     203           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
     204             :                 }
     205           0 :         }
     206           0 :         if (ndr_flags & NDR_BUFFERS) {
     207           0 :                 if (!(ndr_flags & NDR_SCALARS)) {
     208             :                         /* We didn't get it above, and the token is not needed after this. */
     209           0 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     210             :                 }
     211           0 :                 switch (level) {
     212           0 :                         case winspool_PropertyTypeString:
     213           0 :                                 if (r->propertyString) {
     214           0 :                                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->propertyString, CH_UTF16)));
     215           0 :                                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     216           0 :                                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->propertyString, CH_UTF16)));
     217           0 :                                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->propertyString, ndr_charset_length(r->propertyString, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     218             :                                 }
     219           0 :                         break;
     220             : 
     221           0 :                         case winspool_PropertyTypeInt32:
     222           0 :                         break;
     223             : 
     224           0 :                         case winspool_PropertyTypeInt64:
     225           0 :                         break;
     226             : 
     227           0 :                         case winspool_PropertyTypeByte:
     228           0 :                         break;
     229             : 
     230           0 :                         case winspool_PropertyTypeTime:
     231           0 :                                 NDR_CHECK(ndr_push_spoolss_TimeCtr(ndr, NDR_BUFFERS, &r->propertyTimeContainer));
     232           0 :                         break;
     233             : 
     234           0 :                         case winspool_PropertyTypeDevMode:
     235           0 :                                 NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_BUFFERS, &r->propertyDevModeContainer));
     236           0 :                         break;
     237             : 
     238           0 :                         case winspool_PropertyTypeSD:
     239           0 :                                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_BUFFERS, &r->propertySDContainer));
     240           0 :                         break;
     241             : 
     242           0 :                         case winspool_PropertyTypeNotificationReply:
     243           0 :                                 NDR_CHECK(ndr_push_winspool_NOTIFY_REPLY_CONTAINER(ndr, NDR_BUFFERS, &r->propertyReplyContainer));
     244           0 :                         break;
     245             : 
     246           0 :                         case winspool_PropertyTypeNotificationOptions:
     247           0 :                                 NDR_CHECK(ndr_push_winspool_NOTIFY_OPTIONS_CONTAINER(ndr, NDR_BUFFERS, &r->propertyOptionsContainer));
     248           0 :                         break;
     249             : 
     250           0 :                         default:
     251           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
     252             :                 }
     253           0 :         }
     254           0 :         return NDR_ERR_SUCCESS;
     255             : }
     256             : 
     257          16 : static enum ndr_err_code ndr_pull_winspool_PrintPropertyValueUnion(struct ndr_pull *ndr, int ndr_flags, union winspool_PrintPropertyValueUnion *r)
     258             : {
     259             :         uint32_t level;
     260             :         uint16_t _level;
     261          16 :         TALLOC_CTX *_mem_save_propertyString_0 = NULL;
     262             :         uint32_t _ptr_propertyString;
     263          16 :         uint32_t size_propertyString_1 = 0;
     264          16 :         uint32_t length_propertyString_1 = 0;
     265          16 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     266          16 :         if (ndr_flags & NDR_SCALARS) {
     267             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     268           8 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     269           8 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     270           8 :                 NDR_CHECK(ndr_pull_uint1632(ndr, NDR_SCALARS, &_level));
     271           8 :                 if (_level != level) {
     272           0 :                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r at %s", _level, __location__);
     273             :                 }
     274             :                 /* ms_union is always aligned to the largest union arm*/
     275           8 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     276           8 :                 switch (level) {
     277           0 :                         case winspool_PropertyTypeString: {
     278           0 :                                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_propertyString));
     279           0 :                                 if (_ptr_propertyString) {
     280           0 :                                         NDR_PULL_ALLOC(ndr, r->propertyString);
     281             :                                 } else {
     282           0 :                                         r->propertyString = NULL;
     283             :                                 }
     284           0 :                         break; }
     285             : 
     286           6 :                         case winspool_PropertyTypeInt32: {
     287           6 :                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->propertyInt32));
     288           0 :                         break; }
     289             : 
     290           0 :                         case winspool_PropertyTypeInt64: {
     291           0 :                                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->propertyInt64));
     292           0 :                         break; }
     293             : 
     294           0 :                         case winspool_PropertyTypeByte: {
     295           0 :                                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->propertyByte));
     296           0 :                         break; }
     297             : 
     298           0 :                         case winspool_PropertyTypeTime: {
     299           0 :                                 NDR_CHECK(ndr_pull_spoolss_TimeCtr(ndr, NDR_SCALARS, &r->propertyTimeContainer));
     300           0 :                         break; }
     301             : 
     302           0 :                         case winspool_PropertyTypeDevMode: {
     303           0 :                                 NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS, &r->propertyDevModeContainer));
     304           0 :                         break; }
     305             : 
     306           0 :                         case winspool_PropertyTypeSD: {
     307           0 :                                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS, &r->propertySDContainer));
     308           0 :                         break; }
     309             : 
     310           0 :                         case winspool_PropertyTypeNotificationReply: {
     311           0 :                                 NDR_CHECK(ndr_pull_winspool_NOTIFY_REPLY_CONTAINER(ndr, NDR_SCALARS, &r->propertyReplyContainer));
     312           0 :                         break; }
     313             : 
     314           2 :                         case winspool_PropertyTypeNotificationOptions: {
     315           2 :                                 NDR_CHECK(ndr_pull_winspool_NOTIFY_OPTIONS_CONTAINER(ndr, NDR_SCALARS, &r->propertyOptionsContainer));
     316           0 :                         break; }
     317             : 
     318           0 :                         default:
     319           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
     320             :                 }
     321           8 :         }
     322          16 :         if (ndr_flags & NDR_BUFFERS) {
     323           8 :                 if (!(ndr_flags & NDR_SCALARS)) {
     324             :                         /* We didn't get it above, and the token is not needed after this. */
     325           8 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     326             :                 }
     327           8 :                 switch (level) {
     328           0 :                         case winspool_PropertyTypeString:
     329           0 :                                 if (r->propertyString) {
     330           0 :                                         _mem_save_propertyString_0 = NDR_PULL_GET_MEM_CTX(ndr);
     331           0 :                                         NDR_PULL_SET_MEM_CTX(ndr, r->propertyString, 0);
     332           0 :                                         NDR_CHECK(ndr_pull_array_size(ndr, &r->propertyString));
     333           0 :                                         NDR_CHECK(ndr_pull_array_length(ndr, &r->propertyString));
     334           0 :                                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->propertyString, &size_propertyString_1));
     335           0 :                                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->propertyString, &length_propertyString_1));
     336           0 :                                         if (length_propertyString_1 > size_propertyString_1) {
     337           0 :                                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_propertyString_1, length_propertyString_1);
     338             :                                         }
     339           0 :                                         NDR_CHECK(ndr_check_string_terminator(ndr, length_propertyString_1, sizeof(uint16_t)));
     340           0 :                                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->propertyString, length_propertyString_1, sizeof(uint16_t), CH_UTF16));
     341           0 :                                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_propertyString_0, 0);
     342             :                                 }
     343           0 :                         break;
     344             : 
     345           0 :                         case winspool_PropertyTypeInt32:
     346           0 :                         break;
     347             : 
     348           0 :                         case winspool_PropertyTypeInt64:
     349           0 :                         break;
     350             : 
     351           0 :                         case winspool_PropertyTypeByte:
     352           0 :                         break;
     353             : 
     354           0 :                         case winspool_PropertyTypeTime:
     355           0 :                                 NDR_CHECK(ndr_pull_spoolss_TimeCtr(ndr, NDR_BUFFERS, &r->propertyTimeContainer));
     356           0 :                         break;
     357             : 
     358           0 :                         case winspool_PropertyTypeDevMode:
     359           0 :                                 NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_BUFFERS, &r->propertyDevModeContainer));
     360           0 :                         break;
     361             : 
     362           0 :                         case winspool_PropertyTypeSD:
     363           0 :                                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_BUFFERS, &r->propertySDContainer));
     364           0 :                         break;
     365             : 
     366           0 :                         case winspool_PropertyTypeNotificationReply:
     367           0 :                                 NDR_CHECK(ndr_pull_winspool_NOTIFY_REPLY_CONTAINER(ndr, NDR_BUFFERS, &r->propertyReplyContainer));
     368           0 :                         break;
     369             : 
     370           2 :                         case winspool_PropertyTypeNotificationOptions:
     371           2 :                                 NDR_CHECK(ndr_pull_winspool_NOTIFY_OPTIONS_CONTAINER(ndr, NDR_BUFFERS, &r->propertyOptionsContainer));
     372           0 :                         break;
     373             : 
     374           0 :                         default:
     375           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
     376             :                 }
     377           8 :         }
     378           0 :         return NDR_ERR_SUCCESS;
     379             : }
     380             : 
     381           8 : _PUBLIC_ void ndr_print_winspool_PrintPropertyValueUnion(struct ndr_print *ndr, const char *name, const union winspool_PrintPropertyValueUnion *r)
     382             : {
     383             :         uint32_t level;
     384           8 :         level = ndr_print_steal_switch_value(ndr, r);
     385           8 :         ndr_print_union(ndr, name, level, "winspool_PrintPropertyValueUnion");
     386           8 :         switch (level) {
     387           0 :                 case winspool_PropertyTypeString:
     388           0 :                         ndr_print_ptr(ndr, "propertyString", r->propertyString);
     389           0 :                         ndr->depth++;
     390           0 :                         if (r->propertyString) {
     391           0 :                                 ndr_print_string(ndr, "propertyString", r->propertyString);
     392             :                         }
     393           0 :                         ndr->depth--;
     394           0 :                 break;
     395             : 
     396           6 :                 case winspool_PropertyTypeInt32:
     397           6 :                         ndr_print_uint32(ndr, "propertyInt32", r->propertyInt32);
     398           6 :                 break;
     399             : 
     400           0 :                 case winspool_PropertyTypeInt64:
     401           0 :                         ndr_print_hyper(ndr, "propertyInt64", r->propertyInt64);
     402           0 :                 break;
     403             : 
     404           0 :                 case winspool_PropertyTypeByte:
     405           0 :                         ndr_print_uint8(ndr, "propertyByte", r->propertyByte);
     406           0 :                 break;
     407             : 
     408           0 :                 case winspool_PropertyTypeTime:
     409           0 :                         ndr_print_spoolss_TimeCtr(ndr, "propertyTimeContainer", &r->propertyTimeContainer);
     410           0 :                 break;
     411             : 
     412           0 :                 case winspool_PropertyTypeDevMode:
     413           0 :                         ndr_print_spoolss_DevmodeContainer(ndr, "propertyDevModeContainer", &r->propertyDevModeContainer);
     414           0 :                 break;
     415             : 
     416           0 :                 case winspool_PropertyTypeSD:
     417           0 :                         ndr_print_sec_desc_buf(ndr, "propertySDContainer", &r->propertySDContainer);
     418           0 :                 break;
     419             : 
     420           0 :                 case winspool_PropertyTypeNotificationReply:
     421           0 :                         ndr_print_winspool_NOTIFY_REPLY_CONTAINER(ndr, "propertyReplyContainer", &r->propertyReplyContainer);
     422           0 :                 break;
     423             : 
     424           2 :                 case winspool_PropertyTypeNotificationOptions:
     425           2 :                         ndr_print_winspool_NOTIFY_OPTIONS_CONTAINER(ndr, "propertyOptionsContainer", &r->propertyOptionsContainer);
     426           2 :                 break;
     427             : 
     428           0 :                 default:
     429           0 :                         ndr_print_bad_level(ndr, name, level);
     430             :         }
     431           8 : }
     432             : 
     433           0 : static enum ndr_err_code ndr_push_winspool_PrintPropertyValue(struct ndr_push *ndr, int ndr_flags, const struct winspool_PrintPropertyValue *r)
     434             : {
     435           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     436           0 :         if (ndr_flags & NDR_SCALARS) {
     437           0 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     438           0 :                 NDR_CHECK(ndr_push_winspool_PrintPropertyType(ndr, NDR_SCALARS, r->PropertyType));
     439           0 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->value, r->PropertyType));
     440           0 :                 NDR_CHECK(ndr_push_winspool_PrintPropertyValueUnion(ndr, NDR_SCALARS, &r->value));
     441           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     442             :         }
     443           0 :         if (ndr_flags & NDR_BUFFERS) {
     444           0 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->value, r->PropertyType));
     445           0 :                 NDR_CHECK(ndr_push_winspool_PrintPropertyValueUnion(ndr, NDR_BUFFERS, &r->value));
     446             :         }
     447           0 :         return NDR_ERR_SUCCESS;
     448             : }
     449             : 
     450          16 : static enum ndr_err_code ndr_pull_winspool_PrintPropertyValue(struct ndr_pull *ndr, int ndr_flags, struct winspool_PrintPropertyValue *r)
     451             : {
     452          16 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     453          16 :         if (ndr_flags & NDR_SCALARS) {
     454           8 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     455          16 :                 NDR_CHECK(ndr_pull_winspool_PrintPropertyType(ndr, NDR_SCALARS, &r->PropertyType));
     456           8 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->value, r->PropertyType));
     457           8 :                 NDR_CHECK(ndr_pull_winspool_PrintPropertyValueUnion(ndr, NDR_SCALARS, &r->value));
     458           8 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     459             :         }
     460          16 :         if (ndr_flags & NDR_BUFFERS) {
     461           8 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->value, r->PropertyType));
     462           8 :                 NDR_CHECK(ndr_pull_winspool_PrintPropertyValueUnion(ndr, NDR_BUFFERS, &r->value));
     463             :         }
     464           0 :         return NDR_ERR_SUCCESS;
     465             : }
     466             : 
     467           8 : _PUBLIC_ void ndr_print_winspool_PrintPropertyValue(struct ndr_print *ndr, const char *name, const struct winspool_PrintPropertyValue *r)
     468             : {
     469           8 :         ndr_print_struct(ndr, name, "winspool_PrintPropertyValue");
     470           8 :         if (r == NULL) { ndr_print_null(ndr); return; }
     471           8 :         ndr->depth++;
     472           8 :         ndr_print_winspool_PrintPropertyType(ndr, "PropertyType", r->PropertyType);
     473           8 :         ndr_print_set_switch_value(ndr, &r->value, r->PropertyType);
     474           8 :         ndr_print_winspool_PrintPropertyValueUnion(ndr, "value", &r->value);
     475           8 :         ndr->depth--;
     476             : }
     477             : 
     478           0 : static enum ndr_err_code ndr_push_winspool_PrintNamedProperty(struct ndr_push *ndr, int ndr_flags, const struct winspool_PrintNamedProperty *r)
     479             : {
     480           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     481           0 :         if (ndr_flags & NDR_SCALARS) {
     482           0 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     483           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->propertyName));
     484           0 :                 NDR_CHECK(ndr_push_winspool_PrintPropertyValue(ndr, NDR_SCALARS, &r->propertyValue));
     485           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     486             :         }
     487           0 :         if (ndr_flags & NDR_BUFFERS) {
     488           0 :                 if (r->propertyName) {
     489           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->propertyName, CH_UTF16)));
     490           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     491           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->propertyName, CH_UTF16)));
     492           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->propertyName, ndr_charset_length(r->propertyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     493             :                 }
     494           0 :                 NDR_CHECK(ndr_push_winspool_PrintPropertyValue(ndr, NDR_BUFFERS, &r->propertyValue));
     495             :         }
     496           0 :         return NDR_ERR_SUCCESS;
     497             : }
     498             : 
     499          16 : static enum ndr_err_code ndr_pull_winspool_PrintNamedProperty(struct ndr_pull *ndr, int ndr_flags, struct winspool_PrintNamedProperty *r)
     500             : {
     501             :         uint32_t _ptr_propertyName;
     502          16 :         uint32_t size_propertyName_1 = 0;
     503          16 :         uint32_t length_propertyName_1 = 0;
     504          16 :         TALLOC_CTX *_mem_save_propertyName_0 = NULL;
     505          16 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     506          16 :         if (ndr_flags & NDR_SCALARS) {
     507           8 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     508           8 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_propertyName));
     509           8 :                 if (_ptr_propertyName) {
     510           8 :                         NDR_PULL_ALLOC(ndr, r->propertyName);
     511             :                 } else {
     512           0 :                         r->propertyName = NULL;
     513             :                 }
     514           8 :                 NDR_CHECK(ndr_pull_winspool_PrintPropertyValue(ndr, NDR_SCALARS, &r->propertyValue));
     515           8 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     516             :         }
     517          16 :         if (ndr_flags & NDR_BUFFERS) {
     518           8 :                 if (r->propertyName) {
     519           8 :                         _mem_save_propertyName_0 = NDR_PULL_GET_MEM_CTX(ndr);
     520           8 :                         NDR_PULL_SET_MEM_CTX(ndr, r->propertyName, 0);
     521           8 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->propertyName));
     522           8 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->propertyName));
     523           8 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->propertyName, &size_propertyName_1));
     524           8 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->propertyName, &length_propertyName_1));
     525           8 :                         if (length_propertyName_1 > size_propertyName_1) {
     526           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_propertyName_1, length_propertyName_1);
     527             :                         }
     528           8 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_propertyName_1, sizeof(uint16_t)));
     529           8 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->propertyName, length_propertyName_1, sizeof(uint16_t), CH_UTF16));
     530           8 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_propertyName_0, 0);
     531             :                 }
     532           8 :                 NDR_CHECK(ndr_pull_winspool_PrintPropertyValue(ndr, NDR_BUFFERS, &r->propertyValue));
     533             :         }
     534           0 :         return NDR_ERR_SUCCESS;
     535             : }
     536             : 
     537           8 : _PUBLIC_ void ndr_print_winspool_PrintNamedProperty(struct ndr_print *ndr, const char *name, const struct winspool_PrintNamedProperty *r)
     538             : {
     539           8 :         ndr_print_struct(ndr, name, "winspool_PrintNamedProperty");
     540           8 :         if (r == NULL) { ndr_print_null(ndr); return; }
     541           8 :         ndr->depth++;
     542           8 :         ndr_print_ptr(ndr, "propertyName", r->propertyName);
     543           8 :         ndr->depth++;
     544           8 :         if (r->propertyName) {
     545           8 :                 ndr_print_string(ndr, "propertyName", r->propertyName);
     546             :         }
     547           8 :         ndr->depth--;
     548           8 :         ndr_print_winspool_PrintPropertyValue(ndr, "propertyValue", &r->propertyValue);
     549           8 :         ndr->depth--;
     550             : }
     551             : 
     552           0 : static enum ndr_err_code ndr_push_winspool_PrintPropertiesCollection(struct ndr_push *ndr, int ndr_flags, const struct winspool_PrintPropertiesCollection *r)
     553             : {
     554             :         uint32_t cntr_propertiesCollection_1;
     555           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     556           0 :         if (ndr_flags & NDR_SCALARS) {
     557           0 :                 NDR_CHECK(ndr_push_align(ndr, 5));
     558           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->numberOfProperties));
     559           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->propertiesCollection));
     560           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
     561             :         }
     562           0 :         if (ndr_flags & NDR_BUFFERS) {
     563           0 :                 if (r->propertiesCollection) {
     564           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->numberOfProperties));
     565           0 :                         for (cntr_propertiesCollection_1 = 0; cntr_propertiesCollection_1 < (r->numberOfProperties); cntr_propertiesCollection_1++) {
     566           0 :                                 NDR_CHECK(ndr_push_winspool_PrintNamedProperty(ndr, NDR_SCALARS, &r->propertiesCollection[cntr_propertiesCollection_1]));
     567             :                         }
     568           0 :                         for (cntr_propertiesCollection_1 = 0; cntr_propertiesCollection_1 < (r->numberOfProperties); cntr_propertiesCollection_1++) {
     569           0 :                                 NDR_CHECK(ndr_push_winspool_PrintNamedProperty(ndr, NDR_BUFFERS, &r->propertiesCollection[cntr_propertiesCollection_1]));
     570             :                         }
     571             :                 }
     572             :         }
     573           0 :         return NDR_ERR_SUCCESS;
     574             : }
     575             : 
     576           2 : static enum ndr_err_code ndr_pull_winspool_PrintPropertiesCollection(struct ndr_pull *ndr, int ndr_flags, struct winspool_PrintPropertiesCollection *r)
     577             : {
     578             :         uint32_t _ptr_propertiesCollection;
     579           2 :         uint32_t size_propertiesCollection_1 = 0;
     580             :         uint32_t cntr_propertiesCollection_1;
     581           2 :         TALLOC_CTX *_mem_save_propertiesCollection_0 = NULL;
     582           2 :         TALLOC_CTX *_mem_save_propertiesCollection_1 = NULL;
     583           2 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     584           2 :         if (ndr_flags & NDR_SCALARS) {
     585           2 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
     586           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->numberOfProperties));
     587           2 :                 if (r->numberOfProperties > 50) {
     588           0 :                         return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
     589             :                 }
     590           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_propertiesCollection));
     591           2 :                 if (_ptr_propertiesCollection) {
     592           2 :                         NDR_PULL_ALLOC(ndr, r->propertiesCollection);
     593             :                 } else {
     594           0 :                         r->propertiesCollection = NULL;
     595             :                 }
     596           2 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
     597             :         }
     598           2 :         if (ndr_flags & NDR_BUFFERS) {
     599           2 :                 if (r->propertiesCollection) {
     600           2 :                         _mem_save_propertiesCollection_0 = NDR_PULL_GET_MEM_CTX(ndr);
     601           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->propertiesCollection, 0);
     602           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->propertiesCollection));
     603           2 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->propertiesCollection, &size_propertiesCollection_1));
     604           2 :                         NDR_PULL_ALLOC_N(ndr, r->propertiesCollection, size_propertiesCollection_1);
     605           2 :                         _mem_save_propertiesCollection_1 = NDR_PULL_GET_MEM_CTX(ndr);
     606           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->propertiesCollection, 0);
     607          10 :                         for (cntr_propertiesCollection_1 = 0; cntr_propertiesCollection_1 < (size_propertiesCollection_1); cntr_propertiesCollection_1++) {
     608           8 :                                 NDR_CHECK(ndr_pull_winspool_PrintNamedProperty(ndr, NDR_SCALARS, &r->propertiesCollection[cntr_propertiesCollection_1]));
     609             :                         }
     610           8 :                         for (cntr_propertiesCollection_1 = 0; cntr_propertiesCollection_1 < (size_propertiesCollection_1); cntr_propertiesCollection_1++) {
     611           8 :                                 NDR_CHECK(ndr_pull_winspool_PrintNamedProperty(ndr, NDR_BUFFERS, &r->propertiesCollection[cntr_propertiesCollection_1]));
     612             :                         }
     613           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_propertiesCollection_1, 0);
     614           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_propertiesCollection_0, 0);
     615             :                 }
     616           2 :                 if (r->propertiesCollection) {
     617           2 :                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->propertiesCollection, r->numberOfProperties));
     618             :                 }
     619           2 :                 for (cntr_propertiesCollection_1 = 0; cntr_propertiesCollection_1 < (size_propertiesCollection_1); cntr_propertiesCollection_1++) {
     620             :                 }
     621             :         }
     622           0 :         return NDR_ERR_SUCCESS;
     623             : }
     624             : 
     625           2 : _PUBLIC_ void ndr_print_winspool_PrintPropertiesCollection(struct ndr_print *ndr, const char *name, const struct winspool_PrintPropertiesCollection *r)
     626             : {
     627             :         uint32_t cntr_propertiesCollection_1;
     628           2 :         ndr_print_struct(ndr, name, "winspool_PrintPropertiesCollection");
     629           2 :         if (r == NULL) { ndr_print_null(ndr); return; }
     630           2 :         ndr->depth++;
     631           2 :         ndr_print_uint32(ndr, "numberOfProperties", r->numberOfProperties);
     632           2 :         ndr_print_ptr(ndr, "propertiesCollection", r->propertiesCollection);
     633           2 :         ndr->depth++;
     634           2 :         if (r->propertiesCollection) {
     635           2 :                 ndr->print(ndr, "%s: ARRAY(%d)", "propertiesCollection", (int)r->numberOfProperties);
     636           2 :                 ndr->depth++;
     637          10 :                 for (cntr_propertiesCollection_1 = 0; cntr_propertiesCollection_1 < (r->numberOfProperties); cntr_propertiesCollection_1++) {
     638           8 :                         ndr_print_winspool_PrintNamedProperty(ndr, "propertiesCollection", &r->propertiesCollection[cntr_propertiesCollection_1]);
     639             :                 }
     640           2 :                 ndr->depth--;
     641             :         }
     642           2 :         ndr->depth--;
     643           2 :         ndr->depth--;
     644             : }
     645             : 
     646           0 : static enum ndr_err_code ndr_push_winspool_InstallPrinterDriverFromPackageFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
     647             : {
     648           0 :         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
     649           0 :         return NDR_ERR_SUCCESS;
     650             : }
     651             : 
     652           0 : static enum ndr_err_code ndr_pull_winspool_InstallPrinterDriverFromPackageFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
     653             : {
     654             :         uint32_t v;
     655           0 :         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
     656           0 :         *r = v;
     657           0 :         return NDR_ERR_SUCCESS;
     658             : }
     659             : 
     660           0 : _PUBLIC_ void ndr_print_winspool_InstallPrinterDriverFromPackageFlags(struct ndr_print *ndr, const char *name, uint32_t r)
     661             : {
     662           0 :         ndr_print_uint32(ndr, name, r);
     663           0 :         ndr->depth++;
     664           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "IPDFP_FLAG_NONE", IPDFP_FLAG_NONE, r);
     665           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "IPDFP_COPY_ALL_FILES", IPDFP_COPY_ALL_FILES, r);
     666           0 :         ndr->depth--;
     667           0 : }
     668             : 
     669           0 : static enum ndr_err_code ndr_push_winspool_UploadPrinterDriverPackageFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
     670             : {
     671           0 :         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
     672           0 :         return NDR_ERR_SUCCESS;
     673             : }
     674             : 
     675           0 : static enum ndr_err_code ndr_pull_winspool_UploadPrinterDriverPackageFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
     676             : {
     677             :         uint32_t v;
     678           0 :         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
     679           0 :         *r = v;
     680           0 :         return NDR_ERR_SUCCESS;
     681             : }
     682             : 
     683           0 : _PUBLIC_ void ndr_print_winspool_UploadPrinterDriverPackageFlags(struct ndr_print *ndr, const char *name, uint32_t r)
     684             : {
     685           0 :         ndr_print_uint32(ndr, name, r);
     686           0 :         ndr->depth++;
     687           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "UPDP_FLAG_NONE", UPDP_FLAG_NONE, r);
     688           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "UPDP_UPLOAD_ALWAYS", UPDP_UPLOAD_ALWAYS, r);
     689           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "UPDP_CHECK_DRIVERSTORE", UPDP_CHECK_DRIVERSTORE, r);
     690           0 :         ndr->depth--;
     691           0 : }
     692             : 
     693           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncOpenPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncOpenPrinter *r)
     694             : {
     695           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
     696           0 :         if (flags & NDR_IN) {
     697           0 :                 if (r->in.pDevModeContainer == NULL) {
     698           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     699             :                 }
     700           0 :                 if (r->in.pClientInfo == NULL) {
     701           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     702             :                 }
     703           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPrinterName));
     704           0 :                 if (r->in.pPrinterName) {
     705           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrinterName, CH_UTF16)));
     706           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     707           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrinterName, CH_UTF16)));
     708           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPrinterName, ndr_charset_length(r->in.pPrinterName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     709             :                 }
     710           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pDatatype));
     711           0 :                 if (r->in.pDatatype) {
     712           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pDatatype, CH_UTF16)));
     713           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     714           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pDatatype, CH_UTF16)));
     715           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pDatatype, ndr_charset_length(r->in.pDatatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     716             :                 }
     717           0 :                 NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
     718           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.AccessRequired));
     719           0 :                 NDR_CHECK(ndr_push_spoolss_UserLevelCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pClientInfo));
     720             :         }
     721           0 :         if (flags & NDR_OUT) {
     722           0 :                 if (r->out.pHandle == NULL) {
     723           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     724             :                 }
     725           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.pHandle));
     726           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
     727             :         }
     728           0 :         return NDR_ERR_SUCCESS;
     729             : }
     730             : 
     731           8 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncOpenPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncOpenPrinter *r)
     732             : {
     733             :         uint32_t _ptr_pPrinterName;
     734           8 :         uint32_t size_pPrinterName_1 = 0;
     735           8 :         uint32_t length_pPrinterName_1 = 0;
     736             :         uint32_t _ptr_pDatatype;
     737           8 :         uint32_t size_pDatatype_1 = 0;
     738           8 :         uint32_t length_pDatatype_1 = 0;
     739           8 :         TALLOC_CTX *_mem_save_pPrinterName_0 = NULL;
     740           8 :         TALLOC_CTX *_mem_save_pHandle_0 = NULL;
     741           8 :         TALLOC_CTX *_mem_save_pDatatype_0 = NULL;
     742           8 :         TALLOC_CTX *_mem_save_pDevModeContainer_0 = NULL;
     743           8 :         TALLOC_CTX *_mem_save_pClientInfo_0 = NULL;
     744           8 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
     745           8 :         if (flags & NDR_IN) {
     746           6 :                 NDR_ZERO_STRUCT(r->out);
     747             : 
     748           6 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrinterName));
     749           6 :                 if (_ptr_pPrinterName) {
     750           6 :                         NDR_PULL_ALLOC(ndr, r->in.pPrinterName);
     751             :                 } else {
     752           0 :                         r->in.pPrinterName = NULL;
     753             :                 }
     754           6 :                 if (r->in.pPrinterName) {
     755           6 :                         _mem_save_pPrinterName_0 = NDR_PULL_GET_MEM_CTX(ndr);
     756           6 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrinterName, 0);
     757           6 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrinterName));
     758           6 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPrinterName));
     759           6 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPrinterName, &size_pPrinterName_1));
     760           6 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPrinterName, &length_pPrinterName_1));
     761           6 :                         if (length_pPrinterName_1 > size_pPrinterName_1) {
     762           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPrinterName_1, length_pPrinterName_1);
     763             :                         }
     764           6 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pPrinterName_1, sizeof(uint16_t)));
     765           6 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPrinterName, length_pPrinterName_1, sizeof(uint16_t), CH_UTF16));
     766           6 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinterName_0, 0);
     767             :                 }
     768           6 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDatatype));
     769           6 :                 if (_ptr_pDatatype) {
     770           0 :                         NDR_PULL_ALLOC(ndr, r->in.pDatatype);
     771             :                 } else {
     772           6 :                         r->in.pDatatype = NULL;
     773             :                 }
     774           6 :                 if (r->in.pDatatype) {
     775           0 :                         _mem_save_pDatatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
     776           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pDatatype, 0);
     777           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDatatype));
     778           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pDatatype));
     779           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pDatatype, &size_pDatatype_1));
     780           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pDatatype, &length_pDatatype_1));
     781           0 :                         if (length_pDatatype_1 > size_pDatatype_1) {
     782           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pDatatype_1, length_pDatatype_1);
     783             :                         }
     784           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pDatatype_1, sizeof(uint16_t)));
     785           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pDatatype, length_pDatatype_1, sizeof(uint16_t), CH_UTF16));
     786           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDatatype_0, 0);
     787             :                 }
     788           6 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     789           6 :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
     790             :                 }
     791           6 :                 _mem_save_pDevModeContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
     792           6 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pDevModeContainer, LIBNDR_FLAG_REF_ALLOC);
     793           6 :                 NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
     794           6 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDevModeContainer_0, LIBNDR_FLAG_REF_ALLOC);
     795           6 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.AccessRequired));
     796           6 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     797           6 :                         NDR_PULL_ALLOC(ndr, r->in.pClientInfo);
     798             :                 }
     799           6 :                 _mem_save_pClientInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
     800           6 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pClientInfo, LIBNDR_FLAG_REF_ALLOC);
     801           6 :                 NDR_CHECK(ndr_pull_spoolss_UserLevelCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pClientInfo));
     802           6 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pClientInfo_0, LIBNDR_FLAG_REF_ALLOC);
     803           6 :                 NDR_PULL_ALLOC(ndr, r->out.pHandle);
     804           6 :                 NDR_ZERO_STRUCTP(r->out.pHandle);
     805             :         }
     806           8 :         if (flags & NDR_OUT) {
     807             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     808             :                 if (r->in.pDevModeContainer == NULL) {
     809             :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
     810             :                         NDR_ZERO_STRUCTP(r->in.pDevModeContainer);
     811             :                 }
     812             :                 if (r->in.pClientInfo == NULL) {
     813             :                         NDR_PULL_ALLOC(ndr, r->in.pClientInfo);
     814             :                         NDR_ZERO_STRUCTP(r->in.pClientInfo);
     815             :                 }
     816             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
     817           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     818           2 :                         NDR_PULL_ALLOC(ndr, r->out.pHandle);
     819             :                 }
     820           2 :                 _mem_save_pHandle_0 = NDR_PULL_GET_MEM_CTX(ndr);
     821           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pHandle, LIBNDR_FLAG_REF_ALLOC);
     822           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.pHandle));
     823           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pHandle_0, LIBNDR_FLAG_REF_ALLOC);
     824           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
     825             :         }
     826           0 :         return NDR_ERR_SUCCESS;
     827             : }
     828             : 
     829           8 : _PUBLIC_ void ndr_print_winspool_AsyncOpenPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncOpenPrinter *r)
     830             : {
     831           8 :         ndr_print_struct(ndr, name, "winspool_AsyncOpenPrinter");
     832           8 :         if (r == NULL) { ndr_print_null(ndr); return; }
     833           8 :         ndr->depth++;
     834           8 :         if (flags & NDR_SET_VALUES) {
     835           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
     836             :         }
     837           8 :         if (flags & NDR_IN) {
     838           6 :                 ndr_print_struct(ndr, "in", "winspool_AsyncOpenPrinter");
     839           6 :                 ndr->depth++;
     840           6 :                 ndr_print_ptr(ndr, "pPrinterName", r->in.pPrinterName);
     841           6 :                 ndr->depth++;
     842           6 :                 if (r->in.pPrinterName) {
     843           6 :                         ndr_print_string(ndr, "pPrinterName", r->in.pPrinterName);
     844             :                 }
     845           6 :                 ndr->depth--;
     846           6 :                 ndr_print_ptr(ndr, "pDatatype", r->in.pDatatype);
     847           6 :                 ndr->depth++;
     848           6 :                 if (r->in.pDatatype) {
     849           0 :                         ndr_print_string(ndr, "pDatatype", r->in.pDatatype);
     850             :                 }
     851           6 :                 ndr->depth--;
     852           6 :                 ndr_print_ptr(ndr, "pDevModeContainer", r->in.pDevModeContainer);
     853           6 :                 ndr->depth++;
     854           6 :                 ndr_print_spoolss_DevmodeContainer(ndr, "pDevModeContainer", r->in.pDevModeContainer);
     855           6 :                 ndr->depth--;
     856           6 :                 ndr_print_uint32(ndr, "AccessRequired", r->in.AccessRequired);
     857           6 :                 ndr_print_ptr(ndr, "pClientInfo", r->in.pClientInfo);
     858           6 :                 ndr->depth++;
     859           6 :                 ndr_print_spoolss_UserLevelCtr(ndr, "pClientInfo", r->in.pClientInfo);
     860           6 :                 ndr->depth--;
     861           6 :                 ndr->depth--;
     862             :         }
     863           8 :         if (flags & NDR_OUT) {
     864           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncOpenPrinter");
     865           2 :                 ndr->depth++;
     866           2 :                 ndr_print_ptr(ndr, "pHandle", r->out.pHandle);
     867           2 :                 ndr->depth++;
     868           2 :                 ndr_print_policy_handle(ndr, "pHandle", r->out.pHandle);
     869           2 :                 ndr->depth--;
     870           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
     871           2 :                 ndr->depth--;
     872             :         }
     873           8 :         ndr->depth--;
     874             : }
     875             : 
     876           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddPrinter *r)
     877             : {
     878           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
     879           0 :         if (flags & NDR_IN) {
     880           0 :                 if (r->in.pPrinterContainer == NULL) {
     881           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     882             :                 }
     883           0 :                 if (r->in.pDevModeContainer == NULL) {
     884           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     885             :                 }
     886           0 :                 if (r->in.pSecurityContainer == NULL) {
     887           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     888             :                 }
     889           0 :                 if (r->in.pClientInfo == NULL) {
     890           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     891             :                 }
     892           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
     893           0 :                 if (r->in.pName) {
     894           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
     895           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     896           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
     897           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     898             :                 }
     899           0 :                 NDR_CHECK(ndr_push_spoolss_SetPrinterInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPrinterContainer));
     900           0 :                 NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
     901           0 :                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pSecurityContainer));
     902           0 :                 NDR_CHECK(ndr_push_spoolss_UserLevelCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pClientInfo));
     903             :         }
     904           0 :         if (flags & NDR_OUT) {
     905           0 :                 if (r->out.pHandle == NULL) {
     906           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     907             :                 }
     908           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.pHandle));
     909           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
     910             :         }
     911           0 :         return NDR_ERR_SUCCESS;
     912             : }
     913             : 
     914           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddPrinter *r)
     915             : {
     916             :         uint32_t _ptr_pName;
     917           0 :         uint32_t size_pName_1 = 0;
     918           0 :         uint32_t length_pName_1 = 0;
     919           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
     920           0 :         TALLOC_CTX *_mem_save_pPrinterContainer_0 = NULL;
     921           0 :         TALLOC_CTX *_mem_save_pDevModeContainer_0 = NULL;
     922           0 :         TALLOC_CTX *_mem_save_pSecurityContainer_0 = NULL;
     923           0 :         TALLOC_CTX *_mem_save_pClientInfo_0 = NULL;
     924           0 :         TALLOC_CTX *_mem_save_pHandle_0 = NULL;
     925           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
     926           0 :         if (flags & NDR_IN) {
     927           0 :                 NDR_ZERO_STRUCT(r->out);
     928             : 
     929           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
     930           0 :                 if (_ptr_pName) {
     931           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
     932             :                 } else {
     933           0 :                         r->in.pName = NULL;
     934             :                 }
     935           0 :                 if (r->in.pName) {
     936           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
     937           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
     938           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
     939           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
     940           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
     941           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
     942           0 :                         if (length_pName_1 > size_pName_1) {
     943           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
     944             :                         }
     945           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
     946           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
     947           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
     948             :                 }
     949           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     950           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPrinterContainer);
     951             :                 }
     952           0 :                 _mem_save_pPrinterContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
     953           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrinterContainer, LIBNDR_FLAG_REF_ALLOC);
     954           0 :                 NDR_CHECK(ndr_pull_spoolss_SetPrinterInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPrinterContainer));
     955           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinterContainer_0, LIBNDR_FLAG_REF_ALLOC);
     956           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     957           0 :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
     958             :                 }
     959           0 :                 _mem_save_pDevModeContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
     960           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pDevModeContainer, LIBNDR_FLAG_REF_ALLOC);
     961           0 :                 NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
     962           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDevModeContainer_0, LIBNDR_FLAG_REF_ALLOC);
     963           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     964           0 :                         NDR_PULL_ALLOC(ndr, r->in.pSecurityContainer);
     965             :                 }
     966           0 :                 _mem_save_pSecurityContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
     967           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pSecurityContainer, LIBNDR_FLAG_REF_ALLOC);
     968           0 :                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pSecurityContainer));
     969           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pSecurityContainer_0, LIBNDR_FLAG_REF_ALLOC);
     970           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     971           0 :                         NDR_PULL_ALLOC(ndr, r->in.pClientInfo);
     972             :                 }
     973           0 :                 _mem_save_pClientInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
     974           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pClientInfo, LIBNDR_FLAG_REF_ALLOC);
     975           0 :                 NDR_CHECK(ndr_pull_spoolss_UserLevelCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pClientInfo));
     976           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pClientInfo_0, LIBNDR_FLAG_REF_ALLOC);
     977           0 :                 NDR_PULL_ALLOC(ndr, r->out.pHandle);
     978           0 :                 NDR_ZERO_STRUCTP(r->out.pHandle);
     979             :         }
     980           0 :         if (flags & NDR_OUT) {
     981             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     982             :                 if (r->in.pPrinterContainer == NULL) {
     983             :                         NDR_PULL_ALLOC(ndr, r->in.pPrinterContainer);
     984             :                         NDR_ZERO_STRUCTP(r->in.pPrinterContainer);
     985             :                 }
     986             :                 if (r->in.pDevModeContainer == NULL) {
     987             :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
     988             :                         NDR_ZERO_STRUCTP(r->in.pDevModeContainer);
     989             :                 }
     990             :                 if (r->in.pSecurityContainer == NULL) {
     991             :                         NDR_PULL_ALLOC(ndr, r->in.pSecurityContainer);
     992             :                         NDR_ZERO_STRUCTP(r->in.pSecurityContainer);
     993             :                 }
     994             :                 if (r->in.pClientInfo == NULL) {
     995             :                         NDR_PULL_ALLOC(ndr, r->in.pClientInfo);
     996             :                         NDR_ZERO_STRUCTP(r->in.pClientInfo);
     997             :                 }
     998             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
     999           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1000           0 :                         NDR_PULL_ALLOC(ndr, r->out.pHandle);
    1001             :                 }
    1002           0 :                 _mem_save_pHandle_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1003           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pHandle, LIBNDR_FLAG_REF_ALLOC);
    1004           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.pHandle));
    1005           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pHandle_0, LIBNDR_FLAG_REF_ALLOC);
    1006           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1007             :         }
    1008           0 :         return NDR_ERR_SUCCESS;
    1009             : }
    1010             : 
    1011           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddPrinter *r)
    1012             : {
    1013           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddPrinter");
    1014           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1015           0 :         ndr->depth++;
    1016           0 :         if (flags & NDR_SET_VALUES) {
    1017           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1018             :         }
    1019           0 :         if (flags & NDR_IN) {
    1020           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddPrinter");
    1021           0 :                 ndr->depth++;
    1022           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    1023           0 :                 ndr->depth++;
    1024           0 :                 if (r->in.pName) {
    1025           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    1026             :                 }
    1027           0 :                 ndr->depth--;
    1028           0 :                 ndr_print_ptr(ndr, "pPrinterContainer", r->in.pPrinterContainer);
    1029           0 :                 ndr->depth++;
    1030           0 :                 ndr_print_spoolss_SetPrinterInfoCtr(ndr, "pPrinterContainer", r->in.pPrinterContainer);
    1031           0 :                 ndr->depth--;
    1032           0 :                 ndr_print_ptr(ndr, "pDevModeContainer", r->in.pDevModeContainer);
    1033           0 :                 ndr->depth++;
    1034           0 :                 ndr_print_spoolss_DevmodeContainer(ndr, "pDevModeContainer", r->in.pDevModeContainer);
    1035           0 :                 ndr->depth--;
    1036           0 :                 ndr_print_ptr(ndr, "pSecurityContainer", r->in.pSecurityContainer);
    1037           0 :                 ndr->depth++;
    1038           0 :                 ndr_print_sec_desc_buf(ndr, "pSecurityContainer", r->in.pSecurityContainer);
    1039           0 :                 ndr->depth--;
    1040           0 :                 ndr_print_ptr(ndr, "pClientInfo", r->in.pClientInfo);
    1041           0 :                 ndr->depth++;
    1042           0 :                 ndr_print_spoolss_UserLevelCtr(ndr, "pClientInfo", r->in.pClientInfo);
    1043           0 :                 ndr->depth--;
    1044           0 :                 ndr->depth--;
    1045             :         }
    1046           0 :         if (flags & NDR_OUT) {
    1047           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddPrinter");
    1048           0 :                 ndr->depth++;
    1049           0 :                 ndr_print_ptr(ndr, "pHandle", r->out.pHandle);
    1050           0 :                 ndr->depth++;
    1051           0 :                 ndr_print_policy_handle(ndr, "pHandle", r->out.pHandle);
    1052           0 :                 ndr->depth--;
    1053           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1054           0 :                 ndr->depth--;
    1055             :         }
    1056           0 :         ndr->depth--;
    1057             : }
    1058             : 
    1059           0 : static enum ndr_err_code ndr_push_winspool_AsyncSetJob(struct ndr_push *ndr, int flags, const struct winspool_AsyncSetJob *r)
    1060             : {
    1061           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1062           0 :         if (flags & NDR_IN) {
    1063           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1064           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.JobId));
    1065           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pJobContainer));
    1066           0 :                 if (r->in.pJobContainer) {
    1067           0 :                         NDR_CHECK(ndr_push_spoolss_JobInfoContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pJobContainer));
    1068             :                 }
    1069           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Command));
    1070             :         }
    1071           0 :         if (flags & NDR_OUT) {
    1072           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1073             :         }
    1074           0 :         return NDR_ERR_SUCCESS;
    1075             : }
    1076             : 
    1077           0 : static enum ndr_err_code ndr_pull_winspool_AsyncSetJob(struct ndr_pull *ndr, int flags, struct winspool_AsyncSetJob *r)
    1078             : {
    1079             :         uint32_t _ptr_pJobContainer;
    1080           0 :         TALLOC_CTX *_mem_save_pJobContainer_0 = NULL;
    1081           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1082           0 :         if (flags & NDR_IN) {
    1083           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1084           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.JobId));
    1085           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pJobContainer));
    1086           0 :                 if (_ptr_pJobContainer) {
    1087           0 :                         NDR_PULL_ALLOC(ndr, r->in.pJobContainer);
    1088             :                 } else {
    1089           0 :                         r->in.pJobContainer = NULL;
    1090             :                 }
    1091           0 :                 if (r->in.pJobContainer) {
    1092           0 :                         _mem_save_pJobContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1093           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pJobContainer, 0);
    1094           0 :                         NDR_CHECK(ndr_pull_spoolss_JobInfoContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pJobContainer));
    1095           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pJobContainer_0, 0);
    1096             :                 }
    1097           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Command));
    1098             :         }
    1099           0 :         if (flags & NDR_OUT) {
    1100             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1101             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1102           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1103             :         }
    1104           0 :         return NDR_ERR_SUCCESS;
    1105             : }
    1106             : 
    1107           0 : _PUBLIC_ void ndr_print_winspool_AsyncSetJob(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSetJob *r)
    1108             : {
    1109           0 :         ndr_print_struct(ndr, name, "winspool_AsyncSetJob");
    1110           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1111           0 :         ndr->depth++;
    1112           0 :         if (flags & NDR_SET_VALUES) {
    1113           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1114             :         }
    1115           0 :         if (flags & NDR_IN) {
    1116           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSetJob");
    1117           0 :                 ndr->depth++;
    1118           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1119           0 :                 ndr_print_uint32(ndr, "JobId", r->in.JobId);
    1120           0 :                 ndr_print_ptr(ndr, "pJobContainer", r->in.pJobContainer);
    1121           0 :                 ndr->depth++;
    1122           0 :                 if (r->in.pJobContainer) {
    1123           0 :                         ndr_print_spoolss_JobInfoContainer(ndr, "pJobContainer", r->in.pJobContainer);
    1124             :                 }
    1125           0 :                 ndr->depth--;
    1126           0 :                 ndr_print_uint32(ndr, "Command", r->in.Command);
    1127           0 :                 ndr->depth--;
    1128             :         }
    1129           0 :         if (flags & NDR_OUT) {
    1130           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSetJob");
    1131           0 :                 ndr->depth++;
    1132           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1133           0 :                 ndr->depth--;
    1134             :         }
    1135           0 :         ndr->depth--;
    1136             : }
    1137             : 
    1138           0 : static enum ndr_err_code ndr_push_winspool_AsyncGetJob(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetJob *r)
    1139             : {
    1140           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1141           0 :         if (flags & NDR_IN) {
    1142           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1143           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.JobId));
    1144           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    1145           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pJob));
    1146           0 :                 if (r->in.pJob) {
    1147           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1148           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pJob, r->in.cbBuf));
    1149             :                 }
    1150           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    1151             :         }
    1152           0 :         if (flags & NDR_OUT) {
    1153           0 :                 if (r->out.pcbNeeded == NULL) {
    1154           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1155             :                 }
    1156           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pJob));
    1157           0 :                 if (r->out.pJob) {
    1158           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1159           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pJob, r->in.cbBuf));
    1160             :                 }
    1161           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    1162           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1163             :         }
    1164           0 :         return NDR_ERR_SUCCESS;
    1165             : }
    1166             : 
    1167           0 : static enum ndr_err_code ndr_pull_winspool_AsyncGetJob(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetJob *r)
    1168             : {
    1169             :         uint32_t _ptr_pJob;
    1170           0 :         uint32_t size_pJob_1 = 0;
    1171           0 :         TALLOC_CTX *_mem_save_pJob_0 = NULL;
    1172           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    1173           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1174           0 :         if (flags & NDR_IN) {
    1175           0 :                 NDR_ZERO_STRUCT(r->out);
    1176             : 
    1177           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1178           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.JobId));
    1179           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    1180           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pJob));
    1181           0 :                 if (_ptr_pJob) {
    1182           0 :                         NDR_PULL_ALLOC(ndr, r->in.pJob);
    1183             :                 } else {
    1184           0 :                         r->in.pJob = NULL;
    1185             :                 }
    1186           0 :                 if (r->in.pJob) {
    1187           0 :                         _mem_save_pJob_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1188           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pJob, 0);
    1189           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pJob));
    1190           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pJob, &size_pJob_1));
    1191           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pJob, size_pJob_1);
    1192           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pJob, size_pJob_1));
    1193           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pJob_0, 0);
    1194             :                 }
    1195           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    1196           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1197           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    1198           0 :                 if (r->in.pJob) {
    1199           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pJob, r->in.cbBuf));
    1200             :                 }
    1201             :         }
    1202           0 :         if (flags & NDR_OUT) {
    1203             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1204             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1205           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pJob));
    1206           0 :                 if (_ptr_pJob) {
    1207           0 :                         NDR_PULL_ALLOC(ndr, r->out.pJob);
    1208             :                 } else {
    1209           0 :                         r->out.pJob = NULL;
    1210             :                 }
    1211           0 :                 if (r->out.pJob) {
    1212           0 :                         _mem_save_pJob_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1213           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pJob, 0);
    1214           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pJob));
    1215           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pJob, &size_pJob_1));
    1216           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pJob, size_pJob_1);
    1217           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pJob, size_pJob_1));
    1218           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pJob_0, 0);
    1219             :                 }
    1220           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1221           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1222             :                 }
    1223           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1224           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    1225           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    1226           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    1227           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1228           0 :                 if (r->out.pJob) {
    1229           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pJob, r->in.cbBuf));
    1230             :                 }
    1231             :         }
    1232           0 :         return NDR_ERR_SUCCESS;
    1233             : }
    1234             : 
    1235           0 : _PUBLIC_ void ndr_print_winspool_AsyncGetJob(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetJob *r)
    1236             : {
    1237           0 :         ndr_print_struct(ndr, name, "winspool_AsyncGetJob");
    1238           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1239           0 :         ndr->depth++;
    1240           0 :         if (flags & NDR_SET_VALUES) {
    1241           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1242             :         }
    1243           0 :         if (flags & NDR_IN) {
    1244           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetJob");
    1245           0 :                 ndr->depth++;
    1246           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1247           0 :                 ndr_print_uint32(ndr, "JobId", r->in.JobId);
    1248           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    1249           0 :                 ndr_print_ptr(ndr, "pJob", r->in.pJob);
    1250           0 :                 ndr->depth++;
    1251           0 :                 if (r->in.pJob) {
    1252           0 :                         ndr_print_array_uint8(ndr, "pJob", r->in.pJob, r->in.cbBuf);
    1253             :                 }
    1254           0 :                 ndr->depth--;
    1255           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    1256           0 :                 ndr->depth--;
    1257             :         }
    1258           0 :         if (flags & NDR_OUT) {
    1259           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetJob");
    1260           0 :                 ndr->depth++;
    1261           0 :                 ndr_print_ptr(ndr, "pJob", r->out.pJob);
    1262           0 :                 ndr->depth++;
    1263           0 :                 if (r->out.pJob) {
    1264           0 :                         ndr_print_array_uint8(ndr, "pJob", r->out.pJob, r->in.cbBuf);
    1265             :                 }
    1266           0 :                 ndr->depth--;
    1267           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    1268           0 :                 ndr->depth++;
    1269           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    1270           0 :                 ndr->depth--;
    1271           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1272           0 :                 ndr->depth--;
    1273             :         }
    1274           0 :         ndr->depth--;
    1275             : }
    1276             : 
    1277           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumJobs(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumJobs *r)
    1278             : {
    1279           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1280           0 :         if (flags & NDR_IN) {
    1281           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1282           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.FirstJob));
    1283           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.NoJobs));
    1284           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    1285           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pJob));
    1286           0 :                 if (r->in.pJob) {
    1287           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1288           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pJob, r->in.cbBuf));
    1289             :                 }
    1290           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    1291             :         }
    1292           0 :         if (flags & NDR_OUT) {
    1293           0 :                 if (r->out.pcbNeeded == NULL) {
    1294           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1295             :                 }
    1296           0 :                 if (r->out.pcReturned == NULL) {
    1297           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1298             :                 }
    1299           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pJob));
    1300           0 :                 if (r->out.pJob) {
    1301           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1302           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pJob, r->in.cbBuf));
    1303             :                 }
    1304           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    1305           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    1306           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1307             :         }
    1308           0 :         return NDR_ERR_SUCCESS;
    1309             : }
    1310             : 
    1311           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumJobs(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumJobs *r)
    1312             : {
    1313             :         uint32_t _ptr_pJob;
    1314           0 :         uint32_t size_pJob_1 = 0;
    1315           0 :         TALLOC_CTX *_mem_save_pJob_0 = NULL;
    1316           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    1317           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    1318           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1319           0 :         if (flags & NDR_IN) {
    1320           0 :                 NDR_ZERO_STRUCT(r->out);
    1321             : 
    1322           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1323           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.FirstJob));
    1324           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.NoJobs));
    1325           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    1326           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pJob));
    1327           0 :                 if (_ptr_pJob) {
    1328           0 :                         NDR_PULL_ALLOC(ndr, r->in.pJob);
    1329             :                 } else {
    1330           0 :                         r->in.pJob = NULL;
    1331             :                 }
    1332           0 :                 if (r->in.pJob) {
    1333           0 :                         _mem_save_pJob_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1334           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pJob, 0);
    1335           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pJob));
    1336           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pJob, &size_pJob_1));
    1337           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pJob, size_pJob_1);
    1338           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pJob, size_pJob_1));
    1339           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pJob_0, 0);
    1340             :                 }
    1341           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    1342           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1343           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    1344           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    1345           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    1346           0 :                 if (r->in.pJob) {
    1347           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pJob, r->in.cbBuf));
    1348             :                 }
    1349             :         }
    1350           0 :         if (flags & NDR_OUT) {
    1351             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1352             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1353           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pJob));
    1354           0 :                 if (_ptr_pJob) {
    1355           0 :                         NDR_PULL_ALLOC(ndr, r->out.pJob);
    1356             :                 } else {
    1357           0 :                         r->out.pJob = NULL;
    1358             :                 }
    1359           0 :                 if (r->out.pJob) {
    1360           0 :                         _mem_save_pJob_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1361           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pJob, 0);
    1362           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pJob));
    1363           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pJob, &size_pJob_1));
    1364           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pJob, size_pJob_1);
    1365           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pJob, size_pJob_1));
    1366           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pJob_0, 0);
    1367             :                 }
    1368           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1369           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1370             :                 }
    1371           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1372           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    1373           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    1374           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    1375           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1376           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    1377             :                 }
    1378           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1379           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    1380           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    1381           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    1382           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1383           0 :                 if (r->out.pJob) {
    1384           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pJob, r->in.cbBuf));
    1385             :                 }
    1386             :         }
    1387           0 :         return NDR_ERR_SUCCESS;
    1388             : }
    1389             : 
    1390           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumJobs(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumJobs *r)
    1391             : {
    1392           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumJobs");
    1393           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1394           0 :         ndr->depth++;
    1395           0 :         if (flags & NDR_SET_VALUES) {
    1396           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1397             :         }
    1398           0 :         if (flags & NDR_IN) {
    1399           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumJobs");
    1400           0 :                 ndr->depth++;
    1401           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1402           0 :                 ndr_print_uint32(ndr, "FirstJob", r->in.FirstJob);
    1403           0 :                 ndr_print_uint32(ndr, "NoJobs", r->in.NoJobs);
    1404           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    1405           0 :                 ndr_print_ptr(ndr, "pJob", r->in.pJob);
    1406           0 :                 ndr->depth++;
    1407           0 :                 if (r->in.pJob) {
    1408           0 :                         ndr_print_array_uint8(ndr, "pJob", r->in.pJob, r->in.cbBuf);
    1409             :                 }
    1410           0 :                 ndr->depth--;
    1411           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    1412           0 :                 ndr->depth--;
    1413             :         }
    1414           0 :         if (flags & NDR_OUT) {
    1415           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumJobs");
    1416           0 :                 ndr->depth++;
    1417           0 :                 ndr_print_ptr(ndr, "pJob", r->out.pJob);
    1418           0 :                 ndr->depth++;
    1419           0 :                 if (r->out.pJob) {
    1420           0 :                         ndr_print_array_uint8(ndr, "pJob", r->out.pJob, r->in.cbBuf);
    1421             :                 }
    1422           0 :                 ndr->depth--;
    1423           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    1424           0 :                 ndr->depth++;
    1425           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    1426           0 :                 ndr->depth--;
    1427           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    1428           0 :                 ndr->depth++;
    1429           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    1430           0 :                 ndr->depth--;
    1431           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1432           0 :                 ndr->depth--;
    1433             :         }
    1434           0 :         ndr->depth--;
    1435             : }
    1436             : 
    1437           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddJob(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddJob *r)
    1438             : {
    1439           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1440           0 :         if (flags & NDR_IN) {
    1441           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1442           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    1443           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pAddJob));
    1444           0 :                 if (r->in.pAddJob) {
    1445           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1446           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pAddJob, r->in.cbBuf));
    1447             :                 }
    1448           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    1449             :         }
    1450           0 :         if (flags & NDR_OUT) {
    1451           0 :                 if (r->out.pcbNeeded == NULL) {
    1452           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1453             :                 }
    1454           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pAddJob));
    1455           0 :                 if (r->out.pAddJob) {
    1456           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1457           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pAddJob, r->in.cbBuf));
    1458             :                 }
    1459           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    1460           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1461             :         }
    1462           0 :         return NDR_ERR_SUCCESS;
    1463             : }
    1464             : 
    1465           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddJob(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddJob *r)
    1466             : {
    1467             :         uint32_t _ptr_pAddJob;
    1468           0 :         uint32_t size_pAddJob_1 = 0;
    1469           0 :         TALLOC_CTX *_mem_save_pAddJob_0 = NULL;
    1470           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    1471           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1472           0 :         if (flags & NDR_IN) {
    1473           0 :                 NDR_ZERO_STRUCT(r->out);
    1474             : 
    1475           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1476           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    1477           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pAddJob));
    1478           0 :                 if (_ptr_pAddJob) {
    1479           0 :                         NDR_PULL_ALLOC(ndr, r->in.pAddJob);
    1480             :                 } else {
    1481           0 :                         r->in.pAddJob = NULL;
    1482             :                 }
    1483           0 :                 if (r->in.pAddJob) {
    1484           0 :                         _mem_save_pAddJob_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1485           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pAddJob, 0);
    1486           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pAddJob));
    1487           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pAddJob, &size_pAddJob_1));
    1488           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pAddJob, size_pAddJob_1);
    1489           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pAddJob, size_pAddJob_1));
    1490           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pAddJob_0, 0);
    1491             :                 }
    1492           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    1493           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1494           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    1495           0 :                 if (r->in.pAddJob) {
    1496           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pAddJob, r->in.cbBuf));
    1497             :                 }
    1498             :         }
    1499           0 :         if (flags & NDR_OUT) {
    1500             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1501             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1502           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pAddJob));
    1503           0 :                 if (_ptr_pAddJob) {
    1504           0 :                         NDR_PULL_ALLOC(ndr, r->out.pAddJob);
    1505             :                 } else {
    1506           0 :                         r->out.pAddJob = NULL;
    1507             :                 }
    1508           0 :                 if (r->out.pAddJob) {
    1509           0 :                         _mem_save_pAddJob_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1510           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pAddJob, 0);
    1511           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pAddJob));
    1512           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pAddJob, &size_pAddJob_1));
    1513           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pAddJob, size_pAddJob_1);
    1514           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pAddJob, size_pAddJob_1));
    1515           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pAddJob_0, 0);
    1516             :                 }
    1517           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1518           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1519             :                 }
    1520           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1521           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    1522           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    1523           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    1524           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1525           0 :                 if (r->out.pAddJob) {
    1526           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pAddJob, r->in.cbBuf));
    1527             :                 }
    1528             :         }
    1529           0 :         return NDR_ERR_SUCCESS;
    1530             : }
    1531             : 
    1532           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddJob(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddJob *r)
    1533             : {
    1534           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddJob");
    1535           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1536           0 :         ndr->depth++;
    1537           0 :         if (flags & NDR_SET_VALUES) {
    1538           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1539             :         }
    1540           0 :         if (flags & NDR_IN) {
    1541           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddJob");
    1542           0 :                 ndr->depth++;
    1543           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1544           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    1545           0 :                 ndr_print_ptr(ndr, "pAddJob", r->in.pAddJob);
    1546           0 :                 ndr->depth++;
    1547           0 :                 if (r->in.pAddJob) {
    1548           0 :                         ndr_print_array_uint8(ndr, "pAddJob", r->in.pAddJob, r->in.cbBuf);
    1549             :                 }
    1550           0 :                 ndr->depth--;
    1551           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    1552           0 :                 ndr->depth--;
    1553             :         }
    1554           0 :         if (flags & NDR_OUT) {
    1555           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddJob");
    1556           0 :                 ndr->depth++;
    1557           0 :                 ndr_print_ptr(ndr, "pAddJob", r->out.pAddJob);
    1558           0 :                 ndr->depth++;
    1559           0 :                 if (r->out.pAddJob) {
    1560           0 :                         ndr_print_array_uint8(ndr, "pAddJob", r->out.pAddJob, r->in.cbBuf);
    1561             :                 }
    1562           0 :                 ndr->depth--;
    1563           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    1564           0 :                 ndr->depth++;
    1565           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    1566           0 :                 ndr->depth--;
    1567           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1568           0 :                 ndr->depth--;
    1569             :         }
    1570           0 :         ndr->depth--;
    1571             : }
    1572             : 
    1573           0 : static enum ndr_err_code ndr_push_winspool_AsyncScheduleJob(struct ndr_push *ndr, int flags, const struct winspool_AsyncScheduleJob *r)
    1574             : {
    1575           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1576           0 :         if (flags & NDR_IN) {
    1577           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1578           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.JobId));
    1579             :         }
    1580           0 :         if (flags & NDR_OUT) {
    1581           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1582             :         }
    1583           0 :         return NDR_ERR_SUCCESS;
    1584             : }
    1585             : 
    1586           0 : static enum ndr_err_code ndr_pull_winspool_AsyncScheduleJob(struct ndr_pull *ndr, int flags, struct winspool_AsyncScheduleJob *r)
    1587             : {
    1588           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1589           0 :         if (flags & NDR_IN) {
    1590           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1591           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.JobId));
    1592             :         }
    1593           0 :         if (flags & NDR_OUT) {
    1594             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1595             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1596           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1597             :         }
    1598           0 :         return NDR_ERR_SUCCESS;
    1599             : }
    1600             : 
    1601           0 : _PUBLIC_ void ndr_print_winspool_AsyncScheduleJob(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncScheduleJob *r)
    1602             : {
    1603           0 :         ndr_print_struct(ndr, name, "winspool_AsyncScheduleJob");
    1604           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1605           0 :         ndr->depth++;
    1606           0 :         if (flags & NDR_SET_VALUES) {
    1607           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1608             :         }
    1609           0 :         if (flags & NDR_IN) {
    1610           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncScheduleJob");
    1611           0 :                 ndr->depth++;
    1612           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1613           0 :                 ndr_print_uint32(ndr, "JobId", r->in.JobId);
    1614           0 :                 ndr->depth--;
    1615             :         }
    1616           0 :         if (flags & NDR_OUT) {
    1617           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncScheduleJob");
    1618           0 :                 ndr->depth++;
    1619           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1620           0 :                 ndr->depth--;
    1621             :         }
    1622           0 :         ndr->depth--;
    1623             : }
    1624             : 
    1625           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinter *r)
    1626             : {
    1627           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1628           0 :         if (flags & NDR_IN) {
    1629           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1630             :         }
    1631           0 :         if (flags & NDR_OUT) {
    1632           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1633             :         }
    1634           0 :         return NDR_ERR_SUCCESS;
    1635             : }
    1636             : 
    1637           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinter *r)
    1638             : {
    1639           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1640           0 :         if (flags & NDR_IN) {
    1641           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1642             :         }
    1643           0 :         if (flags & NDR_OUT) {
    1644             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1645             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1646           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1647             :         }
    1648           0 :         return NDR_ERR_SUCCESS;
    1649             : }
    1650             : 
    1651           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinter *r)
    1652             : {
    1653           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinter");
    1654           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1655           0 :         ndr->depth++;
    1656           0 :         if (flags & NDR_SET_VALUES) {
    1657           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1658             :         }
    1659           0 :         if (flags & NDR_IN) {
    1660           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinter");
    1661           0 :                 ndr->depth++;
    1662           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1663           0 :                 ndr->depth--;
    1664             :         }
    1665           0 :         if (flags & NDR_OUT) {
    1666           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinter");
    1667           0 :                 ndr->depth++;
    1668           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1669           0 :                 ndr->depth--;
    1670             :         }
    1671           0 :         ndr->depth--;
    1672             : }
    1673             : 
    1674           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncSetPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncSetPrinter *r)
    1675             : {
    1676           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1677           0 :         if (flags & NDR_IN) {
    1678           0 :                 if (r->in.pPrinterContainer == NULL) {
    1679           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1680             :                 }
    1681           0 :                 if (r->in.pDevModeContainer == NULL) {
    1682           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1683             :                 }
    1684           0 :                 if (r->in.pSecurityContainer == NULL) {
    1685           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1686             :                 }
    1687           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1688           0 :                 NDR_CHECK(ndr_push_spoolss_SetPrinterInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPrinterContainer));
    1689           0 :                 NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
    1690           0 :                 NDR_CHECK(ndr_push_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pSecurityContainer));
    1691           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Command));
    1692             :         }
    1693           0 :         if (flags & NDR_OUT) {
    1694           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1695             :         }
    1696           0 :         return NDR_ERR_SUCCESS;
    1697             : }
    1698             : 
    1699           4 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncSetPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncSetPrinter *r)
    1700             : {
    1701           4 :         TALLOC_CTX *_mem_save_pPrinterContainer_0 = NULL;
    1702           4 :         TALLOC_CTX *_mem_save_pDevModeContainer_0 = NULL;
    1703           4 :         TALLOC_CTX *_mem_save_pSecurityContainer_0 = NULL;
    1704           4 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1705           4 :         if (flags & NDR_IN) {
    1706           4 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1707           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1708           4 :                         NDR_PULL_ALLOC(ndr, r->in.pPrinterContainer);
    1709             :                 }
    1710           4 :                 _mem_save_pPrinterContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1711           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrinterContainer, LIBNDR_FLAG_REF_ALLOC);
    1712           4 :                 NDR_CHECK(ndr_pull_spoolss_SetPrinterInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPrinterContainer));
    1713           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinterContainer_0, LIBNDR_FLAG_REF_ALLOC);
    1714           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1715           4 :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
    1716             :                 }
    1717           4 :                 _mem_save_pDevModeContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1718           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pDevModeContainer, LIBNDR_FLAG_REF_ALLOC);
    1719           4 :                 NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
    1720           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDevModeContainer_0, LIBNDR_FLAG_REF_ALLOC);
    1721           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1722           4 :                         NDR_PULL_ALLOC(ndr, r->in.pSecurityContainer);
    1723             :                 }
    1724           4 :                 _mem_save_pSecurityContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1725           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pSecurityContainer, LIBNDR_FLAG_REF_ALLOC);
    1726           4 :                 NDR_CHECK(ndr_pull_sec_desc_buf(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pSecurityContainer));
    1727           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pSecurityContainer_0, LIBNDR_FLAG_REF_ALLOC);
    1728           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Command));
    1729             :         }
    1730           4 :         if (flags & NDR_OUT) {
    1731             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1732             :                 if (r->in.pPrinterContainer == NULL) {
    1733             :                         NDR_PULL_ALLOC(ndr, r->in.pPrinterContainer);
    1734             :                         NDR_ZERO_STRUCTP(r->in.pPrinterContainer);
    1735             :                 }
    1736             :                 if (r->in.pDevModeContainer == NULL) {
    1737             :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
    1738             :                         NDR_ZERO_STRUCTP(r->in.pDevModeContainer);
    1739             :                 }
    1740             :                 if (r->in.pSecurityContainer == NULL) {
    1741             :                         NDR_PULL_ALLOC(ndr, r->in.pSecurityContainer);
    1742             :                         NDR_ZERO_STRUCTP(r->in.pSecurityContainer);
    1743             :                 }
    1744             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1745           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1746             :         }
    1747           0 :         return NDR_ERR_SUCCESS;
    1748             : }
    1749             : 
    1750           4 : _PUBLIC_ void ndr_print_winspool_AsyncSetPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSetPrinter *r)
    1751             : {
    1752           4 :         ndr_print_struct(ndr, name, "winspool_AsyncSetPrinter");
    1753           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1754           4 :         ndr->depth++;
    1755           4 :         if (flags & NDR_SET_VALUES) {
    1756           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1757             :         }
    1758           4 :         if (flags & NDR_IN) {
    1759           4 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSetPrinter");
    1760           4 :                 ndr->depth++;
    1761           4 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1762           4 :                 ndr_print_ptr(ndr, "pPrinterContainer", r->in.pPrinterContainer);
    1763           4 :                 ndr->depth++;
    1764           4 :                 ndr_print_spoolss_SetPrinterInfoCtr(ndr, "pPrinterContainer", r->in.pPrinterContainer);
    1765           4 :                 ndr->depth--;
    1766           4 :                 ndr_print_ptr(ndr, "pDevModeContainer", r->in.pDevModeContainer);
    1767           4 :                 ndr->depth++;
    1768           4 :                 ndr_print_spoolss_DevmodeContainer(ndr, "pDevModeContainer", r->in.pDevModeContainer);
    1769           4 :                 ndr->depth--;
    1770           4 :                 ndr_print_ptr(ndr, "pSecurityContainer", r->in.pSecurityContainer);
    1771           4 :                 ndr->depth++;
    1772           4 :                 ndr_print_sec_desc_buf(ndr, "pSecurityContainer", r->in.pSecurityContainer);
    1773           4 :                 ndr->depth--;
    1774           4 :                 ndr_print_uint32(ndr, "Command", r->in.Command);
    1775           4 :                 ndr->depth--;
    1776             :         }
    1777           4 :         if (flags & NDR_OUT) {
    1778           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSetPrinter");
    1779           0 :                 ndr->depth++;
    1780           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1781           0 :                 ndr->depth--;
    1782             :         }
    1783           4 :         ndr->depth--;
    1784             : }
    1785             : 
    1786           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncGetPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetPrinter *r)
    1787             : {
    1788           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1789           0 :         if (flags & NDR_IN) {
    1790           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1791           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    1792           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPrinter));
    1793           0 :                 if (r->in.pPrinter) {
    1794           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1795           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pPrinter, r->in.cbBuf));
    1796             :                 }
    1797           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    1798             :         }
    1799           0 :         if (flags & NDR_OUT) {
    1800           0 :                 if (r->out.pcbNeeded == NULL) {
    1801           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1802             :                 }
    1803           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pPrinter));
    1804           0 :                 if (r->out.pPrinter) {
    1805           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    1806           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pPrinter, r->in.cbBuf));
    1807             :                 }
    1808           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    1809           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1810             :         }
    1811           0 :         return NDR_ERR_SUCCESS;
    1812             : }
    1813             : 
    1814           4 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncGetPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetPrinter *r)
    1815             : {
    1816             :         uint32_t _ptr_pPrinter;
    1817           4 :         uint32_t size_pPrinter_1 = 0;
    1818           4 :         TALLOC_CTX *_mem_save_pPrinter_0 = NULL;
    1819           4 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    1820           4 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1821           4 :         if (flags & NDR_IN) {
    1822           2 :                 NDR_ZERO_STRUCT(r->out);
    1823             : 
    1824           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1825           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    1826           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrinter));
    1827           2 :                 if (_ptr_pPrinter) {
    1828           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPrinter);
    1829             :                 } else {
    1830           2 :                         r->in.pPrinter = NULL;
    1831             :                 }
    1832           2 :                 if (r->in.pPrinter) {
    1833           0 :                         _mem_save_pPrinter_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1834           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrinter, 0);
    1835           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrinter));
    1836           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pPrinter, &size_pPrinter_1));
    1837           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pPrinter, size_pPrinter_1);
    1838           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pPrinter, size_pPrinter_1));
    1839           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinter_0, 0);
    1840             :                 }
    1841           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    1842           2 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1843           2 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    1844           2 :                 if (r->in.pPrinter) {
    1845           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pPrinter, r->in.cbBuf));
    1846             :                 }
    1847             :         }
    1848           4 :         if (flags & NDR_OUT) {
    1849             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1850             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1851           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrinter));
    1852           2 :                 if (_ptr_pPrinter) {
    1853           0 :                         NDR_PULL_ALLOC(ndr, r->out.pPrinter);
    1854             :                 } else {
    1855           2 :                         r->out.pPrinter = NULL;
    1856             :                 }
    1857           2 :                 if (r->out.pPrinter) {
    1858           0 :                         _mem_save_pPrinter_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1859           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pPrinter, 0);
    1860           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pPrinter));
    1861           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pPrinter, &size_pPrinter_1));
    1862           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pPrinter, size_pPrinter_1);
    1863           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pPrinter, size_pPrinter_1));
    1864           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinter_0, 0);
    1865             :                 }
    1866           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1867           2 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    1868             :                 }
    1869           2 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1870           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    1871           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    1872           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    1873           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1874           2 :                 if (r->out.pPrinter) {
    1875           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pPrinter, r->in.cbBuf));
    1876             :                 }
    1877             :         }
    1878           0 :         return NDR_ERR_SUCCESS;
    1879             : }
    1880             : 
    1881           4 : _PUBLIC_ void ndr_print_winspool_AsyncGetPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetPrinter *r)
    1882             : {
    1883           4 :         ndr_print_struct(ndr, name, "winspool_AsyncGetPrinter");
    1884           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1885           4 :         ndr->depth++;
    1886           4 :         if (flags & NDR_SET_VALUES) {
    1887           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1888             :         }
    1889           4 :         if (flags & NDR_IN) {
    1890           2 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetPrinter");
    1891           2 :                 ndr->depth++;
    1892           2 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1893           2 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    1894           2 :                 ndr_print_ptr(ndr, "pPrinter", r->in.pPrinter);
    1895           2 :                 ndr->depth++;
    1896           2 :                 if (r->in.pPrinter) {
    1897           0 :                         ndr_print_array_uint8(ndr, "pPrinter", r->in.pPrinter, r->in.cbBuf);
    1898             :                 }
    1899           2 :                 ndr->depth--;
    1900           2 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    1901           2 :                 ndr->depth--;
    1902             :         }
    1903           4 :         if (flags & NDR_OUT) {
    1904           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetPrinter");
    1905           2 :                 ndr->depth++;
    1906           2 :                 ndr_print_ptr(ndr, "pPrinter", r->out.pPrinter);
    1907           2 :                 ndr->depth++;
    1908           2 :                 if (r->out.pPrinter) {
    1909           0 :                         ndr_print_array_uint8(ndr, "pPrinter", r->out.pPrinter, r->in.cbBuf);
    1910             :                 }
    1911           2 :                 ndr->depth--;
    1912           2 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    1913           2 :                 ndr->depth++;
    1914           2 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    1915           2 :                 ndr->depth--;
    1916           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1917           2 :                 ndr->depth--;
    1918             :         }
    1919           4 :         ndr->depth--;
    1920             : }
    1921             : 
    1922           0 : static enum ndr_err_code ndr_push_winspool_AsyncStartDocPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncStartDocPrinter *r)
    1923             : {
    1924           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1925           0 :         if (flags & NDR_IN) {
    1926           0 :                 if (r->in.pDocInfoContainer == NULL) {
    1927           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1928             :                 }
    1929           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1930           0 :                 NDR_CHECK(ndr_push_spoolss_DocumentInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDocInfoContainer));
    1931             :         }
    1932           0 :         if (flags & NDR_OUT) {
    1933           0 :                 if (r->out.pJobId == NULL) {
    1934           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1935             :                 }
    1936           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pJobId));
    1937           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1938             :         }
    1939           0 :         return NDR_ERR_SUCCESS;
    1940             : }
    1941             : 
    1942           0 : static enum ndr_err_code ndr_pull_winspool_AsyncStartDocPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncStartDocPrinter *r)
    1943             : {
    1944           0 :         TALLOC_CTX *_mem_save_pDocInfoContainer_0 = NULL;
    1945           0 :         TALLOC_CTX *_mem_save_pJobId_0 = NULL;
    1946           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1947           0 :         if (flags & NDR_IN) {
    1948           0 :                 NDR_ZERO_STRUCT(r->out);
    1949             : 
    1950           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    1951           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1952           0 :                         NDR_PULL_ALLOC(ndr, r->in.pDocInfoContainer);
    1953             :                 }
    1954           0 :                 _mem_save_pDocInfoContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1955           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pDocInfoContainer, LIBNDR_FLAG_REF_ALLOC);
    1956           0 :                 NDR_CHECK(ndr_pull_spoolss_DocumentInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDocInfoContainer));
    1957           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDocInfoContainer_0, LIBNDR_FLAG_REF_ALLOC);
    1958           0 :                 NDR_PULL_ALLOC(ndr, r->out.pJobId);
    1959           0 :                 NDR_ZERO_STRUCTP(r->out.pJobId);
    1960             :         }
    1961           0 :         if (flags & NDR_OUT) {
    1962             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1963             :                 if (r->in.pDocInfoContainer == NULL) {
    1964             :                         NDR_PULL_ALLOC(ndr, r->in.pDocInfoContainer);
    1965             :                         NDR_ZERO_STRUCTP(r->in.pDocInfoContainer);
    1966             :                 }
    1967             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1968           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1969           0 :                         NDR_PULL_ALLOC(ndr, r->out.pJobId);
    1970             :                 }
    1971           0 :                 _mem_save_pJobId_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1972           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pJobId, LIBNDR_FLAG_REF_ALLOC);
    1973           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pJobId));
    1974           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pJobId_0, LIBNDR_FLAG_REF_ALLOC);
    1975           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1976             :         }
    1977           0 :         return NDR_ERR_SUCCESS;
    1978             : }
    1979             : 
    1980           0 : _PUBLIC_ void ndr_print_winspool_AsyncStartDocPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncStartDocPrinter *r)
    1981             : {
    1982           0 :         ndr_print_struct(ndr, name, "winspool_AsyncStartDocPrinter");
    1983           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1984           0 :         ndr->depth++;
    1985           0 :         if (flags & NDR_SET_VALUES) {
    1986           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1987             :         }
    1988           0 :         if (flags & NDR_IN) {
    1989           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncStartDocPrinter");
    1990           0 :                 ndr->depth++;
    1991           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    1992           0 :                 ndr_print_ptr(ndr, "pDocInfoContainer", r->in.pDocInfoContainer);
    1993           0 :                 ndr->depth++;
    1994           0 :                 ndr_print_spoolss_DocumentInfoCtr(ndr, "pDocInfoContainer", r->in.pDocInfoContainer);
    1995           0 :                 ndr->depth--;
    1996           0 :                 ndr->depth--;
    1997             :         }
    1998           0 :         if (flags & NDR_OUT) {
    1999           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncStartDocPrinter");
    2000           0 :                 ndr->depth++;
    2001           0 :                 ndr_print_ptr(ndr, "pJobId", r->out.pJobId);
    2002           0 :                 ndr->depth++;
    2003           0 :                 ndr_print_uint32(ndr, "pJobId", *r->out.pJobId);
    2004           0 :                 ndr->depth--;
    2005           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2006           0 :                 ndr->depth--;
    2007             :         }
    2008           0 :         ndr->depth--;
    2009             : }
    2010             : 
    2011           0 : static enum ndr_err_code ndr_push_winspool_AsyncStartPagePrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncStartPagePrinter *r)
    2012             : {
    2013           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2014           0 :         if (flags & NDR_IN) {
    2015           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2016             :         }
    2017           0 :         if (flags & NDR_OUT) {
    2018           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2019             :         }
    2020           0 :         return NDR_ERR_SUCCESS;
    2021             : }
    2022             : 
    2023           0 : static enum ndr_err_code ndr_pull_winspool_AsyncStartPagePrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncStartPagePrinter *r)
    2024             : {
    2025           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2026           0 :         if (flags & NDR_IN) {
    2027           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2028             :         }
    2029           0 :         if (flags & NDR_OUT) {
    2030             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2031             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2032           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2033             :         }
    2034           0 :         return NDR_ERR_SUCCESS;
    2035             : }
    2036             : 
    2037           0 : _PUBLIC_ void ndr_print_winspool_AsyncStartPagePrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncStartPagePrinter *r)
    2038             : {
    2039           0 :         ndr_print_struct(ndr, name, "winspool_AsyncStartPagePrinter");
    2040           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2041           0 :         ndr->depth++;
    2042           0 :         if (flags & NDR_SET_VALUES) {
    2043           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2044             :         }
    2045           0 :         if (flags & NDR_IN) {
    2046           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncStartPagePrinter");
    2047           0 :                 ndr->depth++;
    2048           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2049           0 :                 ndr->depth--;
    2050             :         }
    2051           0 :         if (flags & NDR_OUT) {
    2052           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncStartPagePrinter");
    2053           0 :                 ndr->depth++;
    2054           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2055           0 :                 ndr->depth--;
    2056             :         }
    2057           0 :         ndr->depth--;
    2058             : }
    2059             : 
    2060           0 : static enum ndr_err_code ndr_push_winspool_AsyncWritePrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncWritePrinter *r)
    2061             : {
    2062           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2063           0 :         if (flags & NDR_IN) {
    2064           0 :                 if (r->in.pBuf == NULL) {
    2065           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2066             :                 }
    2067           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2068           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    2069           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pBuf, r->in.cbBuf));
    2070           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    2071             :         }
    2072           0 :         if (flags & NDR_OUT) {
    2073           0 :                 if (r->out.pcWritten == NULL) {
    2074           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2075             :                 }
    2076           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcWritten));
    2077           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2078             :         }
    2079           0 :         return NDR_ERR_SUCCESS;
    2080             : }
    2081             : 
    2082           0 : static enum ndr_err_code ndr_pull_winspool_AsyncWritePrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncWritePrinter *r)
    2083             : {
    2084           0 :         uint32_t size_pBuf_1 = 0;
    2085           0 :         TALLOC_CTX *_mem_save_pcWritten_0 = NULL;
    2086           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2087           0 :         if (flags & NDR_IN) {
    2088           0 :                 NDR_ZERO_STRUCT(r->out);
    2089             : 
    2090           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2091           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pBuf));
    2092           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pBuf, &size_pBuf_1));
    2093           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2094           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pBuf, size_pBuf_1);
    2095             :                 }
    2096           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pBuf, size_pBuf_1));
    2097           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    2098           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcWritten);
    2099           0 :                 NDR_ZERO_STRUCTP(r->out.pcWritten);
    2100           0 :                 if (r->in.pBuf) {
    2101           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pBuf, r->in.cbBuf));
    2102             :                 }
    2103             :         }
    2104           0 :         if (flags & NDR_OUT) {
    2105             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2106             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2107           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2108           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcWritten);
    2109             :                 }
    2110           0 :                 _mem_save_pcWritten_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2111           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcWritten, LIBNDR_FLAG_REF_ALLOC);
    2112           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcWritten));
    2113           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcWritten_0, LIBNDR_FLAG_REF_ALLOC);
    2114           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2115             :         }
    2116           0 :         return NDR_ERR_SUCCESS;
    2117             : }
    2118             : 
    2119           0 : _PUBLIC_ void ndr_print_winspool_AsyncWritePrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncWritePrinter *r)
    2120             : {
    2121           0 :         ndr_print_struct(ndr, name, "winspool_AsyncWritePrinter");
    2122           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2123           0 :         ndr->depth++;
    2124           0 :         if (flags & NDR_SET_VALUES) {
    2125           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2126             :         }
    2127           0 :         if (flags & NDR_IN) {
    2128           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncWritePrinter");
    2129           0 :                 ndr->depth++;
    2130           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2131           0 :                 ndr_print_ptr(ndr, "pBuf", r->in.pBuf);
    2132           0 :                 ndr->depth++;
    2133           0 :                 ndr_print_array_uint8(ndr, "pBuf", r->in.pBuf, r->in.cbBuf);
    2134           0 :                 ndr->depth--;
    2135           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    2136           0 :                 ndr->depth--;
    2137             :         }
    2138           0 :         if (flags & NDR_OUT) {
    2139           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncWritePrinter");
    2140           0 :                 ndr->depth++;
    2141           0 :                 ndr_print_ptr(ndr, "pcWritten", r->out.pcWritten);
    2142           0 :                 ndr->depth++;
    2143           0 :                 ndr_print_uint32(ndr, "pcWritten", *r->out.pcWritten);
    2144           0 :                 ndr->depth--;
    2145           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2146           0 :                 ndr->depth--;
    2147             :         }
    2148           0 :         ndr->depth--;
    2149             : }
    2150             : 
    2151           0 : static enum ndr_err_code ndr_push_winspool_AsyncEndPagePrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncEndPagePrinter *r)
    2152             : {
    2153           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2154           0 :         if (flags & NDR_IN) {
    2155           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2156             :         }
    2157           0 :         if (flags & NDR_OUT) {
    2158           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2159             :         }
    2160           0 :         return NDR_ERR_SUCCESS;
    2161             : }
    2162             : 
    2163           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEndPagePrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncEndPagePrinter *r)
    2164             : {
    2165           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2166           0 :         if (flags & NDR_IN) {
    2167           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2168             :         }
    2169           0 :         if (flags & NDR_OUT) {
    2170             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2171             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2172           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2173             :         }
    2174           0 :         return NDR_ERR_SUCCESS;
    2175             : }
    2176             : 
    2177           0 : _PUBLIC_ void ndr_print_winspool_AsyncEndPagePrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEndPagePrinter *r)
    2178             : {
    2179           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEndPagePrinter");
    2180           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2181           0 :         ndr->depth++;
    2182           0 :         if (flags & NDR_SET_VALUES) {
    2183           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2184             :         }
    2185           0 :         if (flags & NDR_IN) {
    2186           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEndPagePrinter");
    2187           0 :                 ndr->depth++;
    2188           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2189           0 :                 ndr->depth--;
    2190             :         }
    2191           0 :         if (flags & NDR_OUT) {
    2192           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEndPagePrinter");
    2193           0 :                 ndr->depth++;
    2194           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2195           0 :                 ndr->depth--;
    2196             :         }
    2197           0 :         ndr->depth--;
    2198             : }
    2199             : 
    2200           0 : static enum ndr_err_code ndr_push_winspool_AsyncEndDocPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncEndDocPrinter *r)
    2201             : {
    2202           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2203           0 :         if (flags & NDR_IN) {
    2204           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2205             :         }
    2206           0 :         if (flags & NDR_OUT) {
    2207           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2208             :         }
    2209           0 :         return NDR_ERR_SUCCESS;
    2210             : }
    2211             : 
    2212           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEndDocPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncEndDocPrinter *r)
    2213             : {
    2214           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2215           0 :         if (flags & NDR_IN) {
    2216           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2217             :         }
    2218           0 :         if (flags & NDR_OUT) {
    2219             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2220             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2221           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2222             :         }
    2223           0 :         return NDR_ERR_SUCCESS;
    2224             : }
    2225             : 
    2226           0 : _PUBLIC_ void ndr_print_winspool_AsyncEndDocPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEndDocPrinter *r)
    2227             : {
    2228           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEndDocPrinter");
    2229           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2230           0 :         ndr->depth++;
    2231           0 :         if (flags & NDR_SET_VALUES) {
    2232           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2233             :         }
    2234           0 :         if (flags & NDR_IN) {
    2235           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEndDocPrinter");
    2236           0 :                 ndr->depth++;
    2237           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2238           0 :                 ndr->depth--;
    2239             :         }
    2240           0 :         if (flags & NDR_OUT) {
    2241           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEndDocPrinter");
    2242           0 :                 ndr->depth++;
    2243           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2244           0 :                 ndr->depth--;
    2245             :         }
    2246           0 :         ndr->depth--;
    2247             : }
    2248             : 
    2249           0 : static enum ndr_err_code ndr_push_winspool_AsyncAbortPrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncAbortPrinter *r)
    2250             : {
    2251           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2252           0 :         if (flags & NDR_IN) {
    2253           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2254             :         }
    2255           0 :         if (flags & NDR_OUT) {
    2256           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2257             :         }
    2258           0 :         return NDR_ERR_SUCCESS;
    2259             : }
    2260             : 
    2261           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAbortPrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncAbortPrinter *r)
    2262             : {
    2263           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2264           0 :         if (flags & NDR_IN) {
    2265           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2266             :         }
    2267           0 :         if (flags & NDR_OUT) {
    2268             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2269             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2270           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2271             :         }
    2272           0 :         return NDR_ERR_SUCCESS;
    2273             : }
    2274             : 
    2275           0 : _PUBLIC_ void ndr_print_winspool_AsyncAbortPrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAbortPrinter *r)
    2276             : {
    2277           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAbortPrinter");
    2278           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2279           0 :         ndr->depth++;
    2280           0 :         if (flags & NDR_SET_VALUES) {
    2281           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2282             :         }
    2283           0 :         if (flags & NDR_IN) {
    2284           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAbortPrinter");
    2285           0 :                 ndr->depth++;
    2286           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2287           0 :                 ndr->depth--;
    2288             :         }
    2289           0 :         if (flags & NDR_OUT) {
    2290           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAbortPrinter");
    2291           0 :                 ndr->depth++;
    2292           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2293           0 :                 ndr->depth--;
    2294             :         }
    2295           0 :         ndr->depth--;
    2296             : }
    2297             : 
    2298           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncGetPrinterData(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetPrinterData *r)
    2299             : {
    2300           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2301           0 :         if (flags & NDR_IN) {
    2302           0 :                 if (r->in.pValueName == NULL) {
    2303           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2304             :                 }
    2305           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2306           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2307           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2308           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2309           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pValueName, ndr_charset_length(r->in.pValueName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2310           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.nSize));
    2311             :         }
    2312           0 :         if (flags & NDR_OUT) {
    2313           0 :                 if (r->out.pType == NULL) {
    2314           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2315             :                 }
    2316           0 :                 if (r->out.pData == NULL) {
    2317           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2318             :                 }
    2319           0 :                 if (r->out.pcbNeeded == NULL) {
    2320           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2321             :                 }
    2322           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pType));
    2323           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.nSize));
    2324           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pData, r->in.nSize));
    2325           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    2326           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2327             :         }
    2328           0 :         return NDR_ERR_SUCCESS;
    2329             : }
    2330             : 
    2331           6 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncGetPrinterData(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetPrinterData *r)
    2332             : {
    2333           6 :         uint32_t size_pValueName_1 = 0;
    2334           6 :         uint32_t length_pValueName_1 = 0;
    2335           6 :         uint32_t size_pData_1 = 0;
    2336           6 :         TALLOC_CTX *_mem_save_pType_0 = NULL;
    2337           6 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    2338           6 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2339           6 :         if (flags & NDR_IN) {
    2340           4 :                 NDR_ZERO_STRUCT(r->out);
    2341             : 
    2342           4 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2343           4 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pValueName));
    2344           4 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pValueName));
    2345           4 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pValueName, &size_pValueName_1));
    2346           4 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pValueName, &length_pValueName_1));
    2347           4 :                 if (length_pValueName_1 > size_pValueName_1) {
    2348           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pValueName_1, length_pValueName_1);
    2349             :                 }
    2350           4 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pValueName_1, sizeof(uint16_t)));
    2351           4 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pValueName, length_pValueName_1, sizeof(uint16_t), CH_UTF16));
    2352           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.nSize));
    2353           4 :                 NDR_PULL_ALLOC(ndr, r->out.pType);
    2354           4 :                 NDR_ZERO_STRUCTP(r->out.pType);
    2355           4 :                 NDR_PULL_ALLOC_N(ndr, r->out.pData, r->in.nSize);
    2356           8 :                 memset(r->out.pData, 0, (r->in.nSize) * sizeof(*r->out.pData));
    2357           4 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    2358           4 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    2359             :         }
    2360           6 :         if (flags & NDR_OUT) {
    2361             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2362             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2363           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2364           2 :                         NDR_PULL_ALLOC(ndr, r->out.pType);
    2365             :                 }
    2366           2 :                 _mem_save_pType_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2367           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pType, LIBNDR_FLAG_REF_ALLOC);
    2368           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pType));
    2369           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pType_0, LIBNDR_FLAG_REF_ALLOC);
    2370           2 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pData));
    2371           2 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pData, &size_pData_1));
    2372           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2373           2 :                         NDR_PULL_ALLOC_N(ndr, r->out.pData, size_pData_1);
    2374             :                 }
    2375           2 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pData, size_pData_1));
    2376           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2377           2 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    2378             :                 }
    2379           2 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2380           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    2381           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    2382           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    2383           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2384           2 :                 if (r->out.pData) {
    2385           2 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pData, r->in.nSize));
    2386             :                 }
    2387             :         }
    2388           0 :         return NDR_ERR_SUCCESS;
    2389             : }
    2390             : 
    2391           6 : _PUBLIC_ void ndr_print_winspool_AsyncGetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetPrinterData *r)
    2392             : {
    2393           6 :         ndr_print_struct(ndr, name, "winspool_AsyncGetPrinterData");
    2394           6 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2395           6 :         ndr->depth++;
    2396           6 :         if (flags & NDR_SET_VALUES) {
    2397           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2398             :         }
    2399           6 :         if (flags & NDR_IN) {
    2400           4 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetPrinterData");
    2401           4 :                 ndr->depth++;
    2402           4 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2403           4 :                 ndr_print_ptr(ndr, "pValueName", r->in.pValueName);
    2404           4 :                 ndr->depth++;
    2405           4 :                 ndr_print_string(ndr, "pValueName", r->in.pValueName);
    2406           4 :                 ndr->depth--;
    2407           4 :                 ndr_print_uint32(ndr, "nSize", r->in.nSize);
    2408           4 :                 ndr->depth--;
    2409             :         }
    2410           6 :         if (flags & NDR_OUT) {
    2411           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetPrinterData");
    2412           2 :                 ndr->depth++;
    2413           2 :                 ndr_print_ptr(ndr, "pType", r->out.pType);
    2414           2 :                 ndr->depth++;
    2415           2 :                 ndr_print_uint32(ndr, "pType", *r->out.pType);
    2416           2 :                 ndr->depth--;
    2417           2 :                 ndr_print_ptr(ndr, "pData", r->out.pData);
    2418           2 :                 ndr->depth++;
    2419           2 :                 ndr_print_array_uint8(ndr, "pData", r->out.pData, r->in.nSize);
    2420           2 :                 ndr->depth--;
    2421           2 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    2422           2 :                 ndr->depth++;
    2423           2 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    2424           2 :                 ndr->depth--;
    2425           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2426           2 :                 ndr->depth--;
    2427             :         }
    2428           6 :         ndr->depth--;
    2429             : }
    2430             : 
    2431           0 : static enum ndr_err_code ndr_push_winspool_AsyncGetPrinterDataEx(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetPrinterDataEx *r)
    2432             : {
    2433           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2434           0 :         if (flags & NDR_IN) {
    2435           0 :                 if (r->in.pKeyName == NULL) {
    2436           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2437             :                 }
    2438           0 :                 if (r->in.pValueName == NULL) {
    2439           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2440             :                 }
    2441           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2442           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    2443           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2444           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    2445           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pKeyName, ndr_charset_length(r->in.pKeyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2446           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2447           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2448           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2449           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pValueName, ndr_charset_length(r->in.pValueName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2450           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.nSize));
    2451             :         }
    2452           0 :         if (flags & NDR_OUT) {
    2453           0 :                 if (r->out.pType == NULL) {
    2454           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2455             :                 }
    2456           0 :                 if (r->out.pData == NULL) {
    2457           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2458             :                 }
    2459           0 :                 if (r->out.pcbNeeded == NULL) {
    2460           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2461             :                 }
    2462           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pType));
    2463           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.nSize));
    2464           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pData, r->in.nSize));
    2465           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    2466           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2467             :         }
    2468           0 :         return NDR_ERR_SUCCESS;
    2469             : }
    2470             : 
    2471           0 : static enum ndr_err_code ndr_pull_winspool_AsyncGetPrinterDataEx(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetPrinterDataEx *r)
    2472             : {
    2473           0 :         uint32_t size_pKeyName_1 = 0;
    2474           0 :         uint32_t length_pKeyName_1 = 0;
    2475           0 :         uint32_t size_pValueName_1 = 0;
    2476           0 :         uint32_t length_pValueName_1 = 0;
    2477           0 :         uint32_t size_pData_1 = 0;
    2478           0 :         TALLOC_CTX *_mem_save_pType_0 = NULL;
    2479           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    2480           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2481           0 :         if (flags & NDR_IN) {
    2482           0 :                 NDR_ZERO_STRUCT(r->out);
    2483             : 
    2484           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2485           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pKeyName));
    2486           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pKeyName));
    2487           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pKeyName, &size_pKeyName_1));
    2488           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pKeyName, &length_pKeyName_1));
    2489           0 :                 if (length_pKeyName_1 > size_pKeyName_1) {
    2490           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pKeyName_1, length_pKeyName_1);
    2491             :                 }
    2492           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pKeyName_1, sizeof(uint16_t)));
    2493           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pKeyName, length_pKeyName_1, sizeof(uint16_t), CH_UTF16));
    2494           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pValueName));
    2495           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pValueName));
    2496           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pValueName, &size_pValueName_1));
    2497           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pValueName, &length_pValueName_1));
    2498           0 :                 if (length_pValueName_1 > size_pValueName_1) {
    2499           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pValueName_1, length_pValueName_1);
    2500             :                 }
    2501           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pValueName_1, sizeof(uint16_t)));
    2502           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pValueName, length_pValueName_1, sizeof(uint16_t), CH_UTF16));
    2503           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.nSize));
    2504           0 :                 NDR_PULL_ALLOC(ndr, r->out.pType);
    2505           0 :                 NDR_ZERO_STRUCTP(r->out.pType);
    2506           0 :                 NDR_PULL_ALLOC_N(ndr, r->out.pData, r->in.nSize);
    2507           0 :                 memset(r->out.pData, 0, (r->in.nSize) * sizeof(*r->out.pData));
    2508           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    2509           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    2510             :         }
    2511           0 :         if (flags & NDR_OUT) {
    2512             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2513             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2514           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2515           0 :                         NDR_PULL_ALLOC(ndr, r->out.pType);
    2516             :                 }
    2517           0 :                 _mem_save_pType_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2518           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pType, LIBNDR_FLAG_REF_ALLOC);
    2519           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pType));
    2520           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pType_0, LIBNDR_FLAG_REF_ALLOC);
    2521           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pData));
    2522           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pData, &size_pData_1));
    2523           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2524           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pData, size_pData_1);
    2525             :                 }
    2526           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pData, size_pData_1));
    2527           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2528           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    2529             :                 }
    2530           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2531           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    2532           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    2533           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    2534           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2535           0 :                 if (r->out.pData) {
    2536           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pData, r->in.nSize));
    2537             :                 }
    2538             :         }
    2539           0 :         return NDR_ERR_SUCCESS;
    2540             : }
    2541             : 
    2542           0 : _PUBLIC_ void ndr_print_winspool_AsyncGetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetPrinterDataEx *r)
    2543             : {
    2544           0 :         ndr_print_struct(ndr, name, "winspool_AsyncGetPrinterDataEx");
    2545           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2546           0 :         ndr->depth++;
    2547           0 :         if (flags & NDR_SET_VALUES) {
    2548           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2549             :         }
    2550           0 :         if (flags & NDR_IN) {
    2551           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetPrinterDataEx");
    2552           0 :                 ndr->depth++;
    2553           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2554           0 :                 ndr_print_ptr(ndr, "pKeyName", r->in.pKeyName);
    2555           0 :                 ndr->depth++;
    2556           0 :                 ndr_print_string(ndr, "pKeyName", r->in.pKeyName);
    2557           0 :                 ndr->depth--;
    2558           0 :                 ndr_print_ptr(ndr, "pValueName", r->in.pValueName);
    2559           0 :                 ndr->depth++;
    2560           0 :                 ndr_print_string(ndr, "pValueName", r->in.pValueName);
    2561           0 :                 ndr->depth--;
    2562           0 :                 ndr_print_uint32(ndr, "nSize", r->in.nSize);
    2563           0 :                 ndr->depth--;
    2564             :         }
    2565           0 :         if (flags & NDR_OUT) {
    2566           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetPrinterDataEx");
    2567           0 :                 ndr->depth++;
    2568           0 :                 ndr_print_ptr(ndr, "pType", r->out.pType);
    2569           0 :                 ndr->depth++;
    2570           0 :                 ndr_print_uint32(ndr, "pType", *r->out.pType);
    2571           0 :                 ndr->depth--;
    2572           0 :                 ndr_print_ptr(ndr, "pData", r->out.pData);
    2573           0 :                 ndr->depth++;
    2574           0 :                 ndr_print_array_uint8(ndr, "pData", r->out.pData, r->in.nSize);
    2575           0 :                 ndr->depth--;
    2576           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    2577           0 :                 ndr->depth++;
    2578           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    2579           0 :                 ndr->depth--;
    2580           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2581           0 :                 ndr->depth--;
    2582             :         }
    2583           0 :         ndr->depth--;
    2584             : }
    2585             : 
    2586           0 : static enum ndr_err_code ndr_push_winspool_AsyncSetPrinterData(struct ndr_push *ndr, int flags, const struct winspool_AsyncSetPrinterData *r)
    2587             : {
    2588           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2589           0 :         if (flags & NDR_IN) {
    2590           0 :                 if (r->in.pValueName == NULL) {
    2591           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2592             :                 }
    2593           0 :                 if (r->in.pData == NULL) {
    2594           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2595             :                 }
    2596           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2597           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2598           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2599           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2600           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pValueName, ndr_charset_length(r->in.pValueName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2601           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Type));
    2602           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbData));
    2603           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pData, r->in.cbData));
    2604           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbData));
    2605             :         }
    2606           0 :         if (flags & NDR_OUT) {
    2607           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2608             :         }
    2609           0 :         return NDR_ERR_SUCCESS;
    2610             : }
    2611             : 
    2612           0 : static enum ndr_err_code ndr_pull_winspool_AsyncSetPrinterData(struct ndr_pull *ndr, int flags, struct winspool_AsyncSetPrinterData *r)
    2613             : {
    2614           0 :         uint32_t size_pValueName_1 = 0;
    2615           0 :         uint32_t length_pValueName_1 = 0;
    2616           0 :         uint32_t size_pData_1 = 0;
    2617           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2618           0 :         if (flags & NDR_IN) {
    2619           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2620           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pValueName));
    2621           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pValueName));
    2622           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pValueName, &size_pValueName_1));
    2623           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pValueName, &length_pValueName_1));
    2624           0 :                 if (length_pValueName_1 > size_pValueName_1) {
    2625           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pValueName_1, length_pValueName_1);
    2626             :                 }
    2627           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pValueName_1, sizeof(uint16_t)));
    2628           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pValueName, length_pValueName_1, sizeof(uint16_t), CH_UTF16));
    2629           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Type));
    2630           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pData));
    2631           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pData, &size_pData_1));
    2632           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2633           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pData, size_pData_1);
    2634             :                 }
    2635           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pData, size_pData_1));
    2636           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbData));
    2637           0 :                 if (r->in.pData) {
    2638           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pData, r->in.cbData));
    2639             :                 }
    2640             :         }
    2641           0 :         if (flags & NDR_OUT) {
    2642             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2643             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2644           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2645             :         }
    2646           0 :         return NDR_ERR_SUCCESS;
    2647             : }
    2648             : 
    2649           0 : _PUBLIC_ void ndr_print_winspool_AsyncSetPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSetPrinterData *r)
    2650             : {
    2651           0 :         ndr_print_struct(ndr, name, "winspool_AsyncSetPrinterData");
    2652           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2653           0 :         ndr->depth++;
    2654           0 :         if (flags & NDR_SET_VALUES) {
    2655           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2656             :         }
    2657           0 :         if (flags & NDR_IN) {
    2658           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSetPrinterData");
    2659           0 :                 ndr->depth++;
    2660           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2661           0 :                 ndr_print_ptr(ndr, "pValueName", r->in.pValueName);
    2662           0 :                 ndr->depth++;
    2663           0 :                 ndr_print_string(ndr, "pValueName", r->in.pValueName);
    2664           0 :                 ndr->depth--;
    2665           0 :                 ndr_print_uint32(ndr, "Type", r->in.Type);
    2666           0 :                 ndr_print_ptr(ndr, "pData", r->in.pData);
    2667           0 :                 ndr->depth++;
    2668           0 :                 ndr_print_array_uint8(ndr, "pData", r->in.pData, r->in.cbData);
    2669           0 :                 ndr->depth--;
    2670           0 :                 ndr_print_uint32(ndr, "cbData", r->in.cbData);
    2671           0 :                 ndr->depth--;
    2672             :         }
    2673           0 :         if (flags & NDR_OUT) {
    2674           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSetPrinterData");
    2675           0 :                 ndr->depth++;
    2676           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2677           0 :                 ndr->depth--;
    2678             :         }
    2679           0 :         ndr->depth--;
    2680             : }
    2681             : 
    2682           0 : static enum ndr_err_code ndr_push_winspool_AsyncSetPrinterDataEx(struct ndr_push *ndr, int flags, const struct winspool_AsyncSetPrinterDataEx *r)
    2683             : {
    2684           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2685           0 :         if (flags & NDR_IN) {
    2686           0 :                 if (r->in.pKeyName == NULL) {
    2687           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2688             :                 }
    2689           0 :                 if (r->in.pValueName == NULL) {
    2690           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2691             :                 }
    2692           0 :                 if (r->in.pData == NULL) {
    2693           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2694             :                 }
    2695           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2696           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    2697           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2698           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    2699           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pKeyName, ndr_charset_length(r->in.pKeyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2700           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2701           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2702           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    2703           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pValueName, ndr_charset_length(r->in.pValueName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2704           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Type));
    2705           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbData));
    2706           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pData, r->in.cbData));
    2707           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbData));
    2708             :         }
    2709           0 :         if (flags & NDR_OUT) {
    2710           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2711             :         }
    2712           0 :         return NDR_ERR_SUCCESS;
    2713             : }
    2714             : 
    2715           0 : static enum ndr_err_code ndr_pull_winspool_AsyncSetPrinterDataEx(struct ndr_pull *ndr, int flags, struct winspool_AsyncSetPrinterDataEx *r)
    2716             : {
    2717           0 :         uint32_t size_pKeyName_1 = 0;
    2718           0 :         uint32_t length_pKeyName_1 = 0;
    2719           0 :         uint32_t size_pValueName_1 = 0;
    2720           0 :         uint32_t length_pValueName_1 = 0;
    2721           0 :         uint32_t size_pData_1 = 0;
    2722           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2723           0 :         if (flags & NDR_IN) {
    2724           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2725           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pKeyName));
    2726           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pKeyName));
    2727           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pKeyName, &size_pKeyName_1));
    2728           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pKeyName, &length_pKeyName_1));
    2729           0 :                 if (length_pKeyName_1 > size_pKeyName_1) {
    2730           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pKeyName_1, length_pKeyName_1);
    2731             :                 }
    2732           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pKeyName_1, sizeof(uint16_t)));
    2733           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pKeyName, length_pKeyName_1, sizeof(uint16_t), CH_UTF16));
    2734           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pValueName));
    2735           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pValueName));
    2736           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pValueName, &size_pValueName_1));
    2737           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pValueName, &length_pValueName_1));
    2738           0 :                 if (length_pValueName_1 > size_pValueName_1) {
    2739           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pValueName_1, length_pValueName_1);
    2740             :                 }
    2741           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pValueName_1, sizeof(uint16_t)));
    2742           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pValueName, length_pValueName_1, sizeof(uint16_t), CH_UTF16));
    2743           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Type));
    2744           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pData));
    2745           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pData, &size_pData_1));
    2746           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2747           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pData, size_pData_1);
    2748             :                 }
    2749           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pData, size_pData_1));
    2750           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbData));
    2751           0 :                 if (r->in.pData) {
    2752           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pData, r->in.cbData));
    2753             :                 }
    2754             :         }
    2755           0 :         if (flags & NDR_OUT) {
    2756             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2757             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2758           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2759             :         }
    2760           0 :         return NDR_ERR_SUCCESS;
    2761             : }
    2762             : 
    2763           0 : _PUBLIC_ void ndr_print_winspool_AsyncSetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSetPrinterDataEx *r)
    2764             : {
    2765           0 :         ndr_print_struct(ndr, name, "winspool_AsyncSetPrinterDataEx");
    2766           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2767           0 :         ndr->depth++;
    2768           0 :         if (flags & NDR_SET_VALUES) {
    2769           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2770             :         }
    2771           0 :         if (flags & NDR_IN) {
    2772           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSetPrinterDataEx");
    2773           0 :                 ndr->depth++;
    2774           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2775           0 :                 ndr_print_ptr(ndr, "pKeyName", r->in.pKeyName);
    2776           0 :                 ndr->depth++;
    2777           0 :                 ndr_print_string(ndr, "pKeyName", r->in.pKeyName);
    2778           0 :                 ndr->depth--;
    2779           0 :                 ndr_print_ptr(ndr, "pValueName", r->in.pValueName);
    2780           0 :                 ndr->depth++;
    2781           0 :                 ndr_print_string(ndr, "pValueName", r->in.pValueName);
    2782           0 :                 ndr->depth--;
    2783           0 :                 ndr_print_uint32(ndr, "Type", r->in.Type);
    2784           0 :                 ndr_print_ptr(ndr, "pData", r->in.pData);
    2785           0 :                 ndr->depth++;
    2786           0 :                 ndr_print_array_uint8(ndr, "pData", r->in.pData, r->in.cbData);
    2787           0 :                 ndr->depth--;
    2788           0 :                 ndr_print_uint32(ndr, "cbData", r->in.cbData);
    2789           0 :                 ndr->depth--;
    2790             :         }
    2791           0 :         if (flags & NDR_OUT) {
    2792           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSetPrinterDataEx");
    2793           0 :                 ndr->depth++;
    2794           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2795           0 :                 ndr->depth--;
    2796             :         }
    2797           0 :         ndr->depth--;
    2798             : }
    2799             : 
    2800           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncClosePrinter(struct ndr_push *ndr, int flags, const struct winspool_AsyncClosePrinter *r)
    2801             : {
    2802           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2803           0 :         if (flags & NDR_IN) {
    2804           0 :                 if (r->in.phPrinter == NULL) {
    2805           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2806             :                 }
    2807           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.phPrinter));
    2808             :         }
    2809           0 :         if (flags & NDR_OUT) {
    2810           0 :                 if (r->out.phPrinter == NULL) {
    2811           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2812             :                 }
    2813           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.phPrinter));
    2814           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2815             :         }
    2816           0 :         return NDR_ERR_SUCCESS;
    2817             : }
    2818             : 
    2819           4 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncClosePrinter(struct ndr_pull *ndr, int flags, struct winspool_AsyncClosePrinter *r)
    2820             : {
    2821           4 :         TALLOC_CTX *_mem_save_phPrinter_0 = NULL;
    2822           4 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2823           4 :         if (flags & NDR_IN) {
    2824           2 :                 NDR_ZERO_STRUCT(r->out);
    2825             : 
    2826           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2827           2 :                         NDR_PULL_ALLOC(ndr, r->in.phPrinter);
    2828             :                 }
    2829           2 :                 _mem_save_phPrinter_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2830           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.phPrinter, LIBNDR_FLAG_REF_ALLOC);
    2831           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.phPrinter));
    2832           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_phPrinter_0, LIBNDR_FLAG_REF_ALLOC);
    2833           2 :                 NDR_PULL_ALLOC(ndr, r->out.phPrinter);
    2834           2 :                 *r->out.phPrinter = *r->in.phPrinter;
    2835             :         }
    2836           4 :         if (flags & NDR_OUT) {
    2837             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2838             :                 if (r->in.phPrinter == NULL) {
    2839             :                         NDR_PULL_ALLOC(ndr, r->in.phPrinter);
    2840             :                         NDR_ZERO_STRUCTP(r->in.phPrinter);
    2841             :                 }
    2842             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2843           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2844           2 :                         NDR_PULL_ALLOC(ndr, r->out.phPrinter);
    2845             :                 }
    2846           2 :                 _mem_save_phPrinter_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2847           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.phPrinter, LIBNDR_FLAG_REF_ALLOC);
    2848           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.phPrinter));
    2849           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_phPrinter_0, LIBNDR_FLAG_REF_ALLOC);
    2850           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2851             :         }
    2852           0 :         return NDR_ERR_SUCCESS;
    2853             : }
    2854             : 
    2855           4 : _PUBLIC_ void ndr_print_winspool_AsyncClosePrinter(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncClosePrinter *r)
    2856             : {
    2857           4 :         ndr_print_struct(ndr, name, "winspool_AsyncClosePrinter");
    2858           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2859           4 :         ndr->depth++;
    2860           4 :         if (flags & NDR_SET_VALUES) {
    2861           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2862             :         }
    2863           4 :         if (flags & NDR_IN) {
    2864           2 :                 ndr_print_struct(ndr, "in", "winspool_AsyncClosePrinter");
    2865           2 :                 ndr->depth++;
    2866           2 :                 ndr_print_ptr(ndr, "phPrinter", r->in.phPrinter);
    2867           2 :                 ndr->depth++;
    2868           2 :                 ndr_print_policy_handle(ndr, "phPrinter", r->in.phPrinter);
    2869           2 :                 ndr->depth--;
    2870           2 :                 ndr->depth--;
    2871             :         }
    2872           4 :         if (flags & NDR_OUT) {
    2873           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncClosePrinter");
    2874           2 :                 ndr->depth++;
    2875           2 :                 ndr_print_ptr(ndr, "phPrinter", r->out.phPrinter);
    2876           2 :                 ndr->depth++;
    2877           2 :                 ndr_print_policy_handle(ndr, "phPrinter", r->out.phPrinter);
    2878           2 :                 ndr->depth--;
    2879           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2880           2 :                 ndr->depth--;
    2881             :         }
    2882           4 :         ndr->depth--;
    2883             : }
    2884             : 
    2885           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddForm(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddForm *r)
    2886             : {
    2887           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2888           0 :         if (flags & NDR_IN) {
    2889           0 :                 if (r->in.pFormInfoContainer == NULL) {
    2890           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2891             :                 }
    2892           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2893           0 :                 NDR_CHECK(ndr_push_spoolss_AddFormInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pFormInfoContainer));
    2894             :         }
    2895           0 :         if (flags & NDR_OUT) {
    2896           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2897             :         }
    2898           0 :         return NDR_ERR_SUCCESS;
    2899             : }
    2900             : 
    2901           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddForm(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddForm *r)
    2902             : {
    2903           0 :         TALLOC_CTX *_mem_save_pFormInfoContainer_0 = NULL;
    2904           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2905           0 :         if (flags & NDR_IN) {
    2906           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2907           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    2908           0 :                         NDR_PULL_ALLOC(ndr, r->in.pFormInfoContainer);
    2909             :                 }
    2910           0 :                 _mem_save_pFormInfoContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    2911           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pFormInfoContainer, LIBNDR_FLAG_REF_ALLOC);
    2912           0 :                 NDR_CHECK(ndr_pull_spoolss_AddFormInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pFormInfoContainer));
    2913           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pFormInfoContainer_0, LIBNDR_FLAG_REF_ALLOC);
    2914             :         }
    2915           0 :         if (flags & NDR_OUT) {
    2916             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2917             :                 if (r->in.pFormInfoContainer == NULL) {
    2918             :                         NDR_PULL_ALLOC(ndr, r->in.pFormInfoContainer);
    2919             :                         NDR_ZERO_STRUCTP(r->in.pFormInfoContainer);
    2920             :                 }
    2921             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2922           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2923             :         }
    2924           0 :         return NDR_ERR_SUCCESS;
    2925             : }
    2926             : 
    2927           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddForm(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddForm *r)
    2928             : {
    2929           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddForm");
    2930           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    2931           0 :         ndr->depth++;
    2932           0 :         if (flags & NDR_SET_VALUES) {
    2933           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    2934             :         }
    2935           0 :         if (flags & NDR_IN) {
    2936           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddForm");
    2937           0 :                 ndr->depth++;
    2938           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    2939           0 :                 ndr_print_ptr(ndr, "pFormInfoContainer", r->in.pFormInfoContainer);
    2940           0 :                 ndr->depth++;
    2941           0 :                 ndr_print_spoolss_AddFormInfoCtr(ndr, "pFormInfoContainer", r->in.pFormInfoContainer);
    2942           0 :                 ndr->depth--;
    2943           0 :                 ndr->depth--;
    2944             :         }
    2945           0 :         if (flags & NDR_OUT) {
    2946           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddForm");
    2947           0 :                 ndr->depth++;
    2948           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    2949           0 :                 ndr->depth--;
    2950             :         }
    2951           0 :         ndr->depth--;
    2952             : }
    2953             : 
    2954           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeleteForm(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeleteForm *r)
    2955             : {
    2956           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    2957           0 :         if (flags & NDR_IN) {
    2958           0 :                 if (r->in.pFormName == NULL) {
    2959           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    2960             :                 }
    2961           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2962           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pFormName, CH_UTF16)));
    2963           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    2964           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pFormName, CH_UTF16)));
    2965           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pFormName, ndr_charset_length(r->in.pFormName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    2966             :         }
    2967           0 :         if (flags & NDR_OUT) {
    2968           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    2969             :         }
    2970           0 :         return NDR_ERR_SUCCESS;
    2971             : }
    2972             : 
    2973           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeleteForm(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeleteForm *r)
    2974             : {
    2975           0 :         uint32_t size_pFormName_1 = 0;
    2976           0 :         uint32_t length_pFormName_1 = 0;
    2977           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    2978           0 :         if (flags & NDR_IN) {
    2979           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    2980           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pFormName));
    2981           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pFormName));
    2982           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pFormName, &size_pFormName_1));
    2983           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pFormName, &length_pFormName_1));
    2984           0 :                 if (length_pFormName_1 > size_pFormName_1) {
    2985           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pFormName_1, length_pFormName_1);
    2986             :                 }
    2987           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pFormName_1, sizeof(uint16_t)));
    2988           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pFormName, length_pFormName_1, sizeof(uint16_t), CH_UTF16));
    2989             :         }
    2990           0 :         if (flags & NDR_OUT) {
    2991             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    2992             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    2993           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    2994             :         }
    2995           0 :         return NDR_ERR_SUCCESS;
    2996             : }
    2997             : 
    2998           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeleteForm(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeleteForm *r)
    2999             : {
    3000           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeleteForm");
    3001           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3002           0 :         ndr->depth++;
    3003           0 :         if (flags & NDR_SET_VALUES) {
    3004           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3005             :         }
    3006           0 :         if (flags & NDR_IN) {
    3007           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeleteForm");
    3008           0 :                 ndr->depth++;
    3009           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3010           0 :                 ndr_print_ptr(ndr, "pFormName", r->in.pFormName);
    3011           0 :                 ndr->depth++;
    3012           0 :                 ndr_print_string(ndr, "pFormName", r->in.pFormName);
    3013           0 :                 ndr->depth--;
    3014           0 :                 ndr->depth--;
    3015             :         }
    3016           0 :         if (flags & NDR_OUT) {
    3017           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeleteForm");
    3018           0 :                 ndr->depth++;
    3019           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3020           0 :                 ndr->depth--;
    3021             :         }
    3022           0 :         ndr->depth--;
    3023             : }
    3024             : 
    3025           0 : static enum ndr_err_code ndr_push_winspool_AsyncGetForm(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetForm *r)
    3026             : {
    3027           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3028           0 :         if (flags & NDR_IN) {
    3029           0 :                 if (r->in.pFormName == NULL) {
    3030           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3031             :                 }
    3032           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3033           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pFormName, CH_UTF16)));
    3034           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    3035           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pFormName, CH_UTF16)));
    3036           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pFormName, ndr_charset_length(r->in.pFormName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    3037           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    3038           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pForm));
    3039           0 :                 if (r->in.pForm) {
    3040           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    3041           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pForm, r->in.cbBuf));
    3042             :                 }
    3043           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    3044             :         }
    3045           0 :         if (flags & NDR_OUT) {
    3046           0 :                 if (r->out.pcbNeeded == NULL) {
    3047           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3048             :                 }
    3049           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pForm));
    3050           0 :                 if (r->out.pForm) {
    3051           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    3052           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pForm, r->in.cbBuf));
    3053             :                 }
    3054           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    3055           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3056             :         }
    3057           0 :         return NDR_ERR_SUCCESS;
    3058             : }
    3059             : 
    3060           0 : static enum ndr_err_code ndr_pull_winspool_AsyncGetForm(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetForm *r)
    3061             : {
    3062           0 :         uint32_t size_pFormName_1 = 0;
    3063           0 :         uint32_t length_pFormName_1 = 0;
    3064             :         uint32_t _ptr_pForm;
    3065           0 :         uint32_t size_pForm_1 = 0;
    3066           0 :         TALLOC_CTX *_mem_save_pForm_0 = NULL;
    3067           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    3068           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3069           0 :         if (flags & NDR_IN) {
    3070           0 :                 NDR_ZERO_STRUCT(r->out);
    3071             : 
    3072           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3073           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pFormName));
    3074           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pFormName));
    3075           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pFormName, &size_pFormName_1));
    3076           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pFormName, &length_pFormName_1));
    3077           0 :                 if (length_pFormName_1 > size_pFormName_1) {
    3078           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pFormName_1, length_pFormName_1);
    3079             :                 }
    3080           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pFormName_1, sizeof(uint16_t)));
    3081           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pFormName, length_pFormName_1, sizeof(uint16_t), CH_UTF16));
    3082           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    3083           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pForm));
    3084           0 :                 if (_ptr_pForm) {
    3085           0 :                         NDR_PULL_ALLOC(ndr, r->in.pForm);
    3086             :                 } else {
    3087           0 :                         r->in.pForm = NULL;
    3088             :                 }
    3089           0 :                 if (r->in.pForm) {
    3090           0 :                         _mem_save_pForm_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3091           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pForm, 0);
    3092           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pForm));
    3093           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pForm, &size_pForm_1));
    3094           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pForm, size_pForm_1);
    3095           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pForm, size_pForm_1));
    3096           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pForm_0, 0);
    3097             :                 }
    3098           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    3099           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    3100           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    3101           0 :                 if (r->in.pForm) {
    3102           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pForm, r->in.cbBuf));
    3103             :                 }
    3104             :         }
    3105           0 :         if (flags & NDR_OUT) {
    3106             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    3107             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    3108           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pForm));
    3109           0 :                 if (_ptr_pForm) {
    3110           0 :                         NDR_PULL_ALLOC(ndr, r->out.pForm);
    3111             :                 } else {
    3112           0 :                         r->out.pForm = NULL;
    3113             :                 }
    3114           0 :                 if (r->out.pForm) {
    3115           0 :                         _mem_save_pForm_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3116           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pForm, 0);
    3117           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pForm));
    3118           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pForm, &size_pForm_1));
    3119           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pForm, size_pForm_1);
    3120           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pForm, size_pForm_1));
    3121           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pForm_0, 0);
    3122             :                 }
    3123           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3124           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    3125             :                 }
    3126           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3127           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    3128           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    3129           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    3130           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    3131           0 :                 if (r->out.pForm) {
    3132           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pForm, r->in.cbBuf));
    3133             :                 }
    3134             :         }
    3135           0 :         return NDR_ERR_SUCCESS;
    3136             : }
    3137             : 
    3138           0 : _PUBLIC_ void ndr_print_winspool_AsyncGetForm(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetForm *r)
    3139             : {
    3140           0 :         ndr_print_struct(ndr, name, "winspool_AsyncGetForm");
    3141           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3142           0 :         ndr->depth++;
    3143           0 :         if (flags & NDR_SET_VALUES) {
    3144           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3145             :         }
    3146           0 :         if (flags & NDR_IN) {
    3147           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetForm");
    3148           0 :                 ndr->depth++;
    3149           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3150           0 :                 ndr_print_ptr(ndr, "pFormName", r->in.pFormName);
    3151           0 :                 ndr->depth++;
    3152           0 :                 ndr_print_string(ndr, "pFormName", r->in.pFormName);
    3153           0 :                 ndr->depth--;
    3154           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    3155           0 :                 ndr_print_ptr(ndr, "pForm", r->in.pForm);
    3156           0 :                 ndr->depth++;
    3157           0 :                 if (r->in.pForm) {
    3158           0 :                         ndr_print_array_uint8(ndr, "pForm", r->in.pForm, r->in.cbBuf);
    3159             :                 }
    3160           0 :                 ndr->depth--;
    3161           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    3162           0 :                 ndr->depth--;
    3163             :         }
    3164           0 :         if (flags & NDR_OUT) {
    3165           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetForm");
    3166           0 :                 ndr->depth++;
    3167           0 :                 ndr_print_ptr(ndr, "pForm", r->out.pForm);
    3168           0 :                 ndr->depth++;
    3169           0 :                 if (r->out.pForm) {
    3170           0 :                         ndr_print_array_uint8(ndr, "pForm", r->out.pForm, r->in.cbBuf);
    3171             :                 }
    3172           0 :                 ndr->depth--;
    3173           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    3174           0 :                 ndr->depth++;
    3175           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    3176           0 :                 ndr->depth--;
    3177           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3178           0 :                 ndr->depth--;
    3179             :         }
    3180           0 :         ndr->depth--;
    3181             : }
    3182             : 
    3183           0 : static enum ndr_err_code ndr_push_winspool_AsyncSetForm(struct ndr_push *ndr, int flags, const struct winspool_AsyncSetForm *r)
    3184             : {
    3185           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3186           0 :         if (flags & NDR_IN) {
    3187           0 :                 if (r->in.pFormName == NULL) {
    3188           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3189             :                 }
    3190           0 :                 if (r->in.pFormInfoContainer == NULL) {
    3191           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3192             :                 }
    3193           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3194           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pFormName, CH_UTF16)));
    3195           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    3196           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pFormName, CH_UTF16)));
    3197           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pFormName, ndr_charset_length(r->in.pFormName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    3198           0 :                 NDR_CHECK(ndr_push_spoolss_AddFormInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pFormInfoContainer));
    3199             :         }
    3200           0 :         if (flags & NDR_OUT) {
    3201           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3202             :         }
    3203           0 :         return NDR_ERR_SUCCESS;
    3204             : }
    3205             : 
    3206           0 : static enum ndr_err_code ndr_pull_winspool_AsyncSetForm(struct ndr_pull *ndr, int flags, struct winspool_AsyncSetForm *r)
    3207             : {
    3208           0 :         uint32_t size_pFormName_1 = 0;
    3209           0 :         uint32_t length_pFormName_1 = 0;
    3210           0 :         TALLOC_CTX *_mem_save_pFormInfoContainer_0 = NULL;
    3211           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3212           0 :         if (flags & NDR_IN) {
    3213           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3214           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pFormName));
    3215           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pFormName));
    3216           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pFormName, &size_pFormName_1));
    3217           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pFormName, &length_pFormName_1));
    3218           0 :                 if (length_pFormName_1 > size_pFormName_1) {
    3219           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pFormName_1, length_pFormName_1);
    3220             :                 }
    3221           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pFormName_1, sizeof(uint16_t)));
    3222           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pFormName, length_pFormName_1, sizeof(uint16_t), CH_UTF16));
    3223           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3224           0 :                         NDR_PULL_ALLOC(ndr, r->in.pFormInfoContainer);
    3225             :                 }
    3226           0 :                 _mem_save_pFormInfoContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3227           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pFormInfoContainer, LIBNDR_FLAG_REF_ALLOC);
    3228           0 :                 NDR_CHECK(ndr_pull_spoolss_AddFormInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pFormInfoContainer));
    3229           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pFormInfoContainer_0, LIBNDR_FLAG_REF_ALLOC);
    3230             :         }
    3231           0 :         if (flags & NDR_OUT) {
    3232             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    3233             :                 if (r->in.pFormInfoContainer == NULL) {
    3234             :                         NDR_PULL_ALLOC(ndr, r->in.pFormInfoContainer);
    3235             :                         NDR_ZERO_STRUCTP(r->in.pFormInfoContainer);
    3236             :                 }
    3237             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    3238           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    3239             :         }
    3240           0 :         return NDR_ERR_SUCCESS;
    3241             : }
    3242             : 
    3243           0 : _PUBLIC_ void ndr_print_winspool_AsyncSetForm(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSetForm *r)
    3244             : {
    3245           0 :         ndr_print_struct(ndr, name, "winspool_AsyncSetForm");
    3246           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3247           0 :         ndr->depth++;
    3248           0 :         if (flags & NDR_SET_VALUES) {
    3249           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3250             :         }
    3251           0 :         if (flags & NDR_IN) {
    3252           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSetForm");
    3253           0 :                 ndr->depth++;
    3254           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3255           0 :                 ndr_print_ptr(ndr, "pFormName", r->in.pFormName);
    3256           0 :                 ndr->depth++;
    3257           0 :                 ndr_print_string(ndr, "pFormName", r->in.pFormName);
    3258           0 :                 ndr->depth--;
    3259           0 :                 ndr_print_ptr(ndr, "pFormInfoContainer", r->in.pFormInfoContainer);
    3260           0 :                 ndr->depth++;
    3261           0 :                 ndr_print_spoolss_AddFormInfoCtr(ndr, "pFormInfoContainer", r->in.pFormInfoContainer);
    3262           0 :                 ndr->depth--;
    3263           0 :                 ndr->depth--;
    3264             :         }
    3265           0 :         if (flags & NDR_OUT) {
    3266           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSetForm");
    3267           0 :                 ndr->depth++;
    3268           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3269           0 :                 ndr->depth--;
    3270             :         }
    3271           0 :         ndr->depth--;
    3272             : }
    3273             : 
    3274           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncEnumForms(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumForms *r)
    3275             : {
    3276           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3277           0 :         if (flags & NDR_IN) {
    3278           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3279           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    3280           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pForm));
    3281           0 :                 if (r->in.pForm) {
    3282           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    3283           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pForm, r->in.cbBuf));
    3284             :                 }
    3285           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    3286             :         }
    3287           0 :         if (flags & NDR_OUT) {
    3288           0 :                 if (r->out.pcbNeeded == NULL) {
    3289           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3290             :                 }
    3291           0 :                 if (r->out.pcReturned == NULL) {
    3292           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3293             :                 }
    3294           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pForm));
    3295           0 :                 if (r->out.pForm) {
    3296           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    3297           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pForm, r->in.cbBuf));
    3298             :                 }
    3299           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    3300           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    3301           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3302             :         }
    3303           0 :         return NDR_ERR_SUCCESS;
    3304             : }
    3305             : 
    3306           4 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncEnumForms(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumForms *r)
    3307             : {
    3308             :         uint32_t _ptr_pForm;
    3309           4 :         uint32_t size_pForm_1 = 0;
    3310           4 :         TALLOC_CTX *_mem_save_pForm_0 = NULL;
    3311           4 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    3312           4 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    3313           4 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3314           4 :         if (flags & NDR_IN) {
    3315           2 :                 NDR_ZERO_STRUCT(r->out);
    3316             : 
    3317           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3318           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    3319           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pForm));
    3320           2 :                 if (_ptr_pForm) {
    3321           0 :                         NDR_PULL_ALLOC(ndr, r->in.pForm);
    3322             :                 } else {
    3323           2 :                         r->in.pForm = NULL;
    3324             :                 }
    3325           2 :                 if (r->in.pForm) {
    3326           0 :                         _mem_save_pForm_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3327           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pForm, 0);
    3328           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pForm));
    3329           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pForm, &size_pForm_1));
    3330           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pForm, size_pForm_1);
    3331           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pForm, size_pForm_1));
    3332           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pForm_0, 0);
    3333             :                 }
    3334           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    3335           2 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    3336           2 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    3337           2 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    3338           2 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    3339           2 :                 if (r->in.pForm) {
    3340           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pForm, r->in.cbBuf));
    3341             :                 }
    3342             :         }
    3343           4 :         if (flags & NDR_OUT) {
    3344             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    3345             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    3346           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pForm));
    3347           2 :                 if (_ptr_pForm) {
    3348           0 :                         NDR_PULL_ALLOC(ndr, r->out.pForm);
    3349             :                 } else {
    3350           2 :                         r->out.pForm = NULL;
    3351             :                 }
    3352           2 :                 if (r->out.pForm) {
    3353           0 :                         _mem_save_pForm_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3354           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pForm, 0);
    3355           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pForm));
    3356           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pForm, &size_pForm_1));
    3357           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pForm, size_pForm_1);
    3358           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pForm, size_pForm_1));
    3359           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pForm_0, 0);
    3360             :                 }
    3361           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3362           2 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    3363             :                 }
    3364           2 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3365           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    3366           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    3367           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    3368           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3369           2 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    3370             :                 }
    3371           2 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3372           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    3373           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    3374           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    3375           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    3376           2 :                 if (r->out.pForm) {
    3377           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pForm, r->in.cbBuf));
    3378             :                 }
    3379             :         }
    3380           0 :         return NDR_ERR_SUCCESS;
    3381             : }
    3382             : 
    3383           4 : _PUBLIC_ void ndr_print_winspool_AsyncEnumForms(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumForms *r)
    3384             : {
    3385           4 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumForms");
    3386           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3387           4 :         ndr->depth++;
    3388           4 :         if (flags & NDR_SET_VALUES) {
    3389           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3390             :         }
    3391           4 :         if (flags & NDR_IN) {
    3392           2 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumForms");
    3393           2 :                 ndr->depth++;
    3394           2 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3395           2 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    3396           2 :                 ndr_print_ptr(ndr, "pForm", r->in.pForm);
    3397           2 :                 ndr->depth++;
    3398           2 :                 if (r->in.pForm) {
    3399           0 :                         ndr_print_array_uint8(ndr, "pForm", r->in.pForm, r->in.cbBuf);
    3400             :                 }
    3401           2 :                 ndr->depth--;
    3402           2 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    3403           2 :                 ndr->depth--;
    3404             :         }
    3405           4 :         if (flags & NDR_OUT) {
    3406           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumForms");
    3407           2 :                 ndr->depth++;
    3408           2 :                 ndr_print_ptr(ndr, "pForm", r->out.pForm);
    3409           2 :                 ndr->depth++;
    3410           2 :                 if (r->out.pForm) {
    3411           0 :                         ndr_print_array_uint8(ndr, "pForm", r->out.pForm, r->in.cbBuf);
    3412             :                 }
    3413           2 :                 ndr->depth--;
    3414           2 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    3415           2 :                 ndr->depth++;
    3416           2 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    3417           2 :                 ndr->depth--;
    3418           2 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    3419           2 :                 ndr->depth++;
    3420           2 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    3421           2 :                 ndr->depth--;
    3422           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3423           2 :                 ndr->depth--;
    3424             :         }
    3425           4 :         ndr->depth--;
    3426             : }
    3427             : 
    3428           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncGetPrinterDriver(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetPrinterDriver *r)
    3429             : {
    3430           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3431           0 :         if (flags & NDR_IN) {
    3432           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3433           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    3434           0 :                 if (r->in.pEnvironment) {
    3435           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    3436           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    3437           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    3438           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    3439             :                 }
    3440           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    3441           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pDriver));
    3442           0 :                 if (r->in.pDriver) {
    3443           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    3444           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pDriver, r->in.cbBuf));
    3445             :                 }
    3446           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    3447           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dwClientMajorVersion));
    3448           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dwClientMinorVersion));
    3449             :         }
    3450           0 :         if (flags & NDR_OUT) {
    3451           0 :                 if (r->out.pcbNeeded == NULL) {
    3452           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3453             :                 }
    3454           0 :                 if (r->out.pdwServerMaxVersion == NULL) {
    3455           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3456             :                 }
    3457           0 :                 if (r->out.pdwServerMinVersion == NULL) {
    3458           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3459             :                 }
    3460           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pDriver));
    3461           0 :                 if (r->out.pDriver) {
    3462           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    3463           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pDriver, r->in.cbBuf));
    3464             :                 }
    3465           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    3466           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pdwServerMaxVersion));
    3467           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pdwServerMinVersion));
    3468           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3469             :         }
    3470           0 :         return NDR_ERR_SUCCESS;
    3471             : }
    3472             : 
    3473           6 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncGetPrinterDriver(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetPrinterDriver *r)
    3474             : {
    3475             :         uint32_t _ptr_pEnvironment;
    3476           6 :         uint32_t size_pEnvironment_1 = 0;
    3477           6 :         uint32_t length_pEnvironment_1 = 0;
    3478             :         uint32_t _ptr_pDriver;
    3479           6 :         uint32_t size_pDriver_1 = 0;
    3480           6 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    3481           6 :         TALLOC_CTX *_mem_save_pDriver_0 = NULL;
    3482           6 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    3483           6 :         TALLOC_CTX *_mem_save_pdwServerMaxVersion_0 = NULL;
    3484           6 :         TALLOC_CTX *_mem_save_pdwServerMinVersion_0 = NULL;
    3485           6 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3486           6 :         if (flags & NDR_IN) {
    3487           4 :                 NDR_ZERO_STRUCT(r->out);
    3488             : 
    3489           4 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3490           4 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    3491           4 :                 if (_ptr_pEnvironment) {
    3492           4 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    3493             :                 } else {
    3494           0 :                         r->in.pEnvironment = NULL;
    3495             :                 }
    3496           4 :                 if (r->in.pEnvironment) {
    3497           4 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3498           4 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    3499           4 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    3500           4 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    3501           4 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    3502           4 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    3503           4 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    3504           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    3505             :                         }
    3506           4 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    3507           4 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    3508           4 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    3509             :                 }
    3510           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    3511           4 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDriver));
    3512           4 :                 if (_ptr_pDriver) {
    3513           4 :                         NDR_PULL_ALLOC(ndr, r->in.pDriver);
    3514             :                 } else {
    3515           0 :                         r->in.pDriver = NULL;
    3516             :                 }
    3517           4 :                 if (r->in.pDriver) {
    3518           4 :                         _mem_save_pDriver_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3519           4 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pDriver, 0);
    3520           4 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDriver));
    3521           4 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pDriver, &size_pDriver_1));
    3522           4 :                         NDR_PULL_ALLOC_N(ndr, r->in.pDriver, size_pDriver_1);
    3523           4 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pDriver, size_pDriver_1));
    3524           4 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDriver_0, 0);
    3525             :                 }
    3526           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    3527           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dwClientMajorVersion));
    3528           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dwClientMinorVersion));
    3529           4 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    3530           4 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    3531           4 :                 NDR_PULL_ALLOC(ndr, r->out.pdwServerMaxVersion);
    3532           4 :                 NDR_ZERO_STRUCTP(r->out.pdwServerMaxVersion);
    3533           4 :                 NDR_PULL_ALLOC(ndr, r->out.pdwServerMinVersion);
    3534           4 :                 NDR_ZERO_STRUCTP(r->out.pdwServerMinVersion);
    3535           4 :                 if (r->in.pDriver) {
    3536           4 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pDriver, r->in.cbBuf));
    3537             :                 }
    3538             :         }
    3539           6 :         if (flags & NDR_OUT) {
    3540             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    3541             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    3542           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDriver));
    3543           2 :                 if (_ptr_pDriver) {
    3544           2 :                         NDR_PULL_ALLOC(ndr, r->out.pDriver);
    3545             :                 } else {
    3546           0 :                         r->out.pDriver = NULL;
    3547             :                 }
    3548           2 :                 if (r->out.pDriver) {
    3549           2 :                         _mem_save_pDriver_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3550           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pDriver, 0);
    3551           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pDriver));
    3552           2 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pDriver, &size_pDriver_1));
    3553           2 :                         NDR_PULL_ALLOC_N(ndr, r->out.pDriver, size_pDriver_1);
    3554           2 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pDriver, size_pDriver_1));
    3555           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDriver_0, 0);
    3556             :                 }
    3557           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3558           2 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    3559             :                 }
    3560           2 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3561           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    3562           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    3563           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    3564           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3565           2 :                         NDR_PULL_ALLOC(ndr, r->out.pdwServerMaxVersion);
    3566             :                 }
    3567           2 :                 _mem_save_pdwServerMaxVersion_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3568           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pdwServerMaxVersion, LIBNDR_FLAG_REF_ALLOC);
    3569           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pdwServerMaxVersion));
    3570           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pdwServerMaxVersion_0, LIBNDR_FLAG_REF_ALLOC);
    3571           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3572           2 :                         NDR_PULL_ALLOC(ndr, r->out.pdwServerMinVersion);
    3573             :                 }
    3574           2 :                 _mem_save_pdwServerMinVersion_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3575           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pdwServerMinVersion, LIBNDR_FLAG_REF_ALLOC);
    3576           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pdwServerMinVersion));
    3577           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pdwServerMinVersion_0, LIBNDR_FLAG_REF_ALLOC);
    3578           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    3579           2 :                 if (r->out.pDriver) {
    3580           2 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pDriver, r->in.cbBuf));
    3581             :                 }
    3582             :         }
    3583           0 :         return NDR_ERR_SUCCESS;
    3584             : }
    3585             : 
    3586           6 : _PUBLIC_ void ndr_print_winspool_AsyncGetPrinterDriver(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetPrinterDriver *r)
    3587             : {
    3588           6 :         ndr_print_struct(ndr, name, "winspool_AsyncGetPrinterDriver");
    3589           6 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3590           6 :         ndr->depth++;
    3591           6 :         if (flags & NDR_SET_VALUES) {
    3592           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3593             :         }
    3594           6 :         if (flags & NDR_IN) {
    3595           4 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetPrinterDriver");
    3596           4 :                 ndr->depth++;
    3597           4 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3598           4 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    3599           4 :                 ndr->depth++;
    3600           4 :                 if (r->in.pEnvironment) {
    3601           4 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    3602             :                 }
    3603           4 :                 ndr->depth--;
    3604           4 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    3605           4 :                 ndr_print_ptr(ndr, "pDriver", r->in.pDriver);
    3606           4 :                 ndr->depth++;
    3607           4 :                 if (r->in.pDriver) {
    3608           4 :                         ndr_print_array_uint8(ndr, "pDriver", r->in.pDriver, r->in.cbBuf);
    3609             :                 }
    3610           4 :                 ndr->depth--;
    3611           4 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    3612           4 :                 ndr_print_uint32(ndr, "dwClientMajorVersion", r->in.dwClientMajorVersion);
    3613           4 :                 ndr_print_uint32(ndr, "dwClientMinorVersion", r->in.dwClientMinorVersion);
    3614           4 :                 ndr->depth--;
    3615             :         }
    3616           6 :         if (flags & NDR_OUT) {
    3617           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetPrinterDriver");
    3618           2 :                 ndr->depth++;
    3619           2 :                 ndr_print_ptr(ndr, "pDriver", r->out.pDriver);
    3620           2 :                 ndr->depth++;
    3621           2 :                 if (r->out.pDriver) {
    3622           2 :                         ndr_print_array_uint8(ndr, "pDriver", r->out.pDriver, r->in.cbBuf);
    3623             :                 }
    3624           2 :                 ndr->depth--;
    3625           2 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    3626           2 :                 ndr->depth++;
    3627           2 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    3628           2 :                 ndr->depth--;
    3629           2 :                 ndr_print_ptr(ndr, "pdwServerMaxVersion", r->out.pdwServerMaxVersion);
    3630           2 :                 ndr->depth++;
    3631           2 :                 ndr_print_uint32(ndr, "pdwServerMaxVersion", *r->out.pdwServerMaxVersion);
    3632           2 :                 ndr->depth--;
    3633           2 :                 ndr_print_ptr(ndr, "pdwServerMinVersion", r->out.pdwServerMinVersion);
    3634           2 :                 ndr->depth++;
    3635           2 :                 ndr_print_uint32(ndr, "pdwServerMinVersion", *r->out.pdwServerMinVersion);
    3636           2 :                 ndr->depth--;
    3637           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3638           2 :                 ndr->depth--;
    3639             :         }
    3640           6 :         ndr->depth--;
    3641             : }
    3642             : 
    3643           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumPrinterData(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrinterData *r)
    3644             : {
    3645             :         uint32_t cntr_pValueName_1;
    3646           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3647           0 :         if (flags & NDR_IN) {
    3648           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3649           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dwIndex));
    3650           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbValueName));
    3651           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbData));
    3652             :         }
    3653           0 :         if (flags & NDR_OUT) {
    3654           0 :                 if (r->out.pValueName == NULL) {
    3655           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3656             :                 }
    3657           0 :                 if (r->out.pcbValueName == NULL) {
    3658           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3659             :                 }
    3660           0 :                 if (r->out.pType == NULL) {
    3661           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3662             :                 }
    3663           0 :                 if (r->out.pData == NULL) {
    3664           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3665             :                 }
    3666           0 :                 if (r->out.pcbData == NULL) {
    3667           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3668             :                 }
    3669           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbValueName / 2));
    3670           0 :                 for (cntr_pValueName_1 = 0; cntr_pValueName_1 < (r->in.cbValueName / 2); cntr_pValueName_1++) {
    3671           0 :                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.pValueName[cntr_pValueName_1]));
    3672             :                 }
    3673           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbValueName));
    3674           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pType));
    3675           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbData));
    3676           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pData, r->in.cbData));
    3677           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbData));
    3678           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3679             :         }
    3680           0 :         return NDR_ERR_SUCCESS;
    3681             : }
    3682             : 
    3683           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumPrinterData(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrinterData *r)
    3684             : {
    3685           0 :         uint32_t size_pValueName_1 = 0;
    3686             :         uint32_t cntr_pValueName_1;
    3687           0 :         uint32_t size_pData_1 = 0;
    3688           0 :         TALLOC_CTX *_mem_save_pValueName_1 = NULL;
    3689           0 :         TALLOC_CTX *_mem_save_pcbValueName_0 = NULL;
    3690           0 :         TALLOC_CTX *_mem_save_pType_0 = NULL;
    3691           0 :         TALLOC_CTX *_mem_save_pcbData_0 = NULL;
    3692           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3693           0 :         if (flags & NDR_IN) {
    3694           0 :                 NDR_ZERO_STRUCT(r->out);
    3695             : 
    3696           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3697           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dwIndex));
    3698           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbValueName));
    3699           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbData));
    3700           0 :                 NDR_PULL_ALLOC_N(ndr, r->out.pValueName, r->in.cbValueName / 2);
    3701           0 :                 memset(r->out.pValueName, 0, (r->in.cbValueName / 2) * sizeof(*r->out.pValueName));
    3702           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbValueName);
    3703           0 :                 NDR_ZERO_STRUCTP(r->out.pcbValueName);
    3704           0 :                 NDR_PULL_ALLOC(ndr, r->out.pType);
    3705           0 :                 NDR_ZERO_STRUCTP(r->out.pType);
    3706           0 :                 NDR_PULL_ALLOC_N(ndr, r->out.pData, r->in.cbData);
    3707           0 :                 memset(r->out.pData, 0, (r->in.cbData) * sizeof(*r->out.pData));
    3708           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbData);
    3709           0 :                 NDR_ZERO_STRUCTP(r->out.pcbData);
    3710             :         }
    3711           0 :         if (flags & NDR_OUT) {
    3712             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    3713             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    3714           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pValueName));
    3715           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pValueName, &size_pValueName_1));
    3716           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3717           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pValueName, size_pValueName_1);
    3718             :                 }
    3719           0 :                 _mem_save_pValueName_1 = NDR_PULL_GET_MEM_CTX(ndr);
    3720           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pValueName, 0);
    3721           0 :                 for (cntr_pValueName_1 = 0; cntr_pValueName_1 < (size_pValueName_1); cntr_pValueName_1++) {
    3722           0 :                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.pValueName[cntr_pValueName_1]));
    3723             :                 }
    3724           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pValueName_1, 0);
    3725           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3726           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbValueName);
    3727             :                 }
    3728           0 :                 _mem_save_pcbValueName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3729           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbValueName, LIBNDR_FLAG_REF_ALLOC);
    3730           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbValueName));
    3731           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbValueName_0, LIBNDR_FLAG_REF_ALLOC);
    3732           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3733           0 :                         NDR_PULL_ALLOC(ndr, r->out.pType);
    3734             :                 }
    3735           0 :                 _mem_save_pType_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3736           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pType, LIBNDR_FLAG_REF_ALLOC);
    3737           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pType));
    3738           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pType_0, LIBNDR_FLAG_REF_ALLOC);
    3739           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pData));
    3740           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pData, &size_pData_1));
    3741           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3742           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pData, size_pData_1);
    3743             :                 }
    3744           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pData, size_pData_1));
    3745           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3746           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbData);
    3747             :                 }
    3748           0 :                 _mem_save_pcbData_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3749           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbData, LIBNDR_FLAG_REF_ALLOC);
    3750           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbData));
    3751           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbData_0, LIBNDR_FLAG_REF_ALLOC);
    3752           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    3753           0 :                 if (r->out.pValueName) {
    3754           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pValueName, r->in.cbValueName / 2));
    3755             :                 }
    3756           0 :                 if (r->out.pData) {
    3757           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pData, r->in.cbData));
    3758             :                 }
    3759             :         }
    3760           0 :         return NDR_ERR_SUCCESS;
    3761             : }
    3762             : 
    3763           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrinterData(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrinterData *r)
    3764             : {
    3765             :         uint32_t cntr_pValueName_1;
    3766           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrinterData");
    3767           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3768           0 :         ndr->depth++;
    3769           0 :         if (flags & NDR_SET_VALUES) {
    3770           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3771             :         }
    3772           0 :         if (flags & NDR_IN) {
    3773           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrinterData");
    3774           0 :                 ndr->depth++;
    3775           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3776           0 :                 ndr_print_uint32(ndr, "dwIndex", r->in.dwIndex);
    3777           0 :                 ndr_print_uint32(ndr, "cbValueName", r->in.cbValueName);
    3778           0 :                 ndr_print_uint32(ndr, "cbData", r->in.cbData);
    3779           0 :                 ndr->depth--;
    3780             :         }
    3781           0 :         if (flags & NDR_OUT) {
    3782           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrinterData");
    3783           0 :                 ndr->depth++;
    3784           0 :                 ndr_print_ptr(ndr, "pValueName", r->out.pValueName);
    3785           0 :                 ndr->depth++;
    3786           0 :                 ndr->print(ndr, "%s: ARRAY(%d)", "pValueName", (int)r->in.cbValueName / 2);
    3787           0 :                 ndr->depth++;
    3788           0 :                 for (cntr_pValueName_1 = 0; cntr_pValueName_1 < (r->in.cbValueName / 2); cntr_pValueName_1++) {
    3789           0 :                         ndr_print_uint16(ndr, "pValueName", r->out.pValueName[cntr_pValueName_1]);
    3790             :                 }
    3791           0 :                 ndr->depth--;
    3792           0 :                 ndr->depth--;
    3793           0 :                 ndr_print_ptr(ndr, "pcbValueName", r->out.pcbValueName);
    3794           0 :                 ndr->depth++;
    3795           0 :                 ndr_print_uint32(ndr, "pcbValueName", *r->out.pcbValueName);
    3796           0 :                 ndr->depth--;
    3797           0 :                 ndr_print_ptr(ndr, "pType", r->out.pType);
    3798           0 :                 ndr->depth++;
    3799           0 :                 ndr_print_uint32(ndr, "pType", *r->out.pType);
    3800           0 :                 ndr->depth--;
    3801           0 :                 ndr_print_ptr(ndr, "pData", r->out.pData);
    3802           0 :                 ndr->depth++;
    3803           0 :                 ndr_print_array_uint8(ndr, "pData", r->out.pData, r->in.cbData);
    3804           0 :                 ndr->depth--;
    3805           0 :                 ndr_print_ptr(ndr, "pcbData", r->out.pcbData);
    3806           0 :                 ndr->depth++;
    3807           0 :                 ndr_print_uint32(ndr, "pcbData", *r->out.pcbData);
    3808           0 :                 ndr->depth--;
    3809           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3810           0 :                 ndr->depth--;
    3811             :         }
    3812           0 :         ndr->depth--;
    3813             : }
    3814             : 
    3815           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncEnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrinterDataEx *r)
    3816             : {
    3817           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3818           0 :         if (flags & NDR_IN) {
    3819           0 :                 if (r->in.pKeyName == NULL) {
    3820           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3821             :                 }
    3822           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3823           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    3824           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    3825           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    3826           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pKeyName, ndr_charset_length(r->in.pKeyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    3827           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbEnumValues));
    3828             :         }
    3829           0 :         if (flags & NDR_OUT) {
    3830           0 :                 if (r->out.pEnumValues == NULL) {
    3831           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3832             :                 }
    3833           0 :                 if (r->out.pcbEnumValues == NULL) {
    3834           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3835             :                 }
    3836           0 :                 if (r->out.pnEnumValues == NULL) {
    3837           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3838             :                 }
    3839           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbEnumValues));
    3840           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pEnumValues, r->in.cbEnumValues));
    3841           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbEnumValues));
    3842           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pnEnumValues));
    3843           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3844             :         }
    3845           0 :         return NDR_ERR_SUCCESS;
    3846             : }
    3847             : 
    3848           8 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncEnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrinterDataEx *r)
    3849             : {
    3850           8 :         uint32_t size_pKeyName_1 = 0;
    3851           8 :         uint32_t length_pKeyName_1 = 0;
    3852           8 :         uint32_t size_pEnumValues_1 = 0;
    3853           8 :         TALLOC_CTX *_mem_save_pcbEnumValues_0 = NULL;
    3854           8 :         TALLOC_CTX *_mem_save_pnEnumValues_0 = NULL;
    3855           8 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3856           8 :         if (flags & NDR_IN) {
    3857           4 :                 NDR_ZERO_STRUCT(r->out);
    3858             : 
    3859           4 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3860           4 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pKeyName));
    3861           4 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pKeyName));
    3862           4 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pKeyName, &size_pKeyName_1));
    3863           4 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pKeyName, &length_pKeyName_1));
    3864           4 :                 if (length_pKeyName_1 > size_pKeyName_1) {
    3865           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pKeyName_1, length_pKeyName_1);
    3866             :                 }
    3867           4 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pKeyName_1, sizeof(uint16_t)));
    3868           4 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pKeyName, length_pKeyName_1, sizeof(uint16_t), CH_UTF16));
    3869           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbEnumValues));
    3870           4 :                 NDR_PULL_ALLOC_N(ndr, r->out.pEnumValues, r->in.cbEnumValues);
    3871           8 :                 memset(r->out.pEnumValues, 0, (r->in.cbEnumValues) * sizeof(*r->out.pEnumValues));
    3872           4 :                 NDR_PULL_ALLOC(ndr, r->out.pcbEnumValues);
    3873           4 :                 NDR_ZERO_STRUCTP(r->out.pcbEnumValues);
    3874           4 :                 NDR_PULL_ALLOC(ndr, r->out.pnEnumValues);
    3875           4 :                 NDR_ZERO_STRUCTP(r->out.pnEnumValues);
    3876             :         }
    3877           8 :         if (flags & NDR_OUT) {
    3878             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    3879             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    3880           4 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pEnumValues));
    3881           4 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pEnumValues, &size_pEnumValues_1));
    3882           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3883           4 :                         NDR_PULL_ALLOC_N(ndr, r->out.pEnumValues, size_pEnumValues_1);
    3884             :                 }
    3885           4 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pEnumValues, size_pEnumValues_1));
    3886           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3887           4 :                         NDR_PULL_ALLOC(ndr, r->out.pcbEnumValues);
    3888             :                 }
    3889           4 :                 _mem_save_pcbEnumValues_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3890           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbEnumValues, LIBNDR_FLAG_REF_ALLOC);
    3891           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbEnumValues));
    3892           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbEnumValues_0, LIBNDR_FLAG_REF_ALLOC);
    3893           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    3894           4 :                         NDR_PULL_ALLOC(ndr, r->out.pnEnumValues);
    3895             :                 }
    3896           4 :                 _mem_save_pnEnumValues_0 = NDR_PULL_GET_MEM_CTX(ndr);
    3897           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pnEnumValues, LIBNDR_FLAG_REF_ALLOC);
    3898           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pnEnumValues));
    3899           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pnEnumValues_0, LIBNDR_FLAG_REF_ALLOC);
    3900           4 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    3901           4 :                 if (r->out.pEnumValues) {
    3902           4 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pEnumValues, r->in.cbEnumValues));
    3903             :                 }
    3904             :         }
    3905           0 :         return NDR_ERR_SUCCESS;
    3906             : }
    3907             : 
    3908           8 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrinterDataEx *r)
    3909             : {
    3910           8 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrinterDataEx");
    3911           8 :         if (r == NULL) { ndr_print_null(ndr); return; }
    3912           8 :         ndr->depth++;
    3913           8 :         if (flags & NDR_SET_VALUES) {
    3914           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    3915             :         }
    3916           8 :         if (flags & NDR_IN) {
    3917           4 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrinterDataEx");
    3918           4 :                 ndr->depth++;
    3919           4 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    3920           4 :                 ndr_print_ptr(ndr, "pKeyName", r->in.pKeyName);
    3921           4 :                 ndr->depth++;
    3922           4 :                 ndr_print_string(ndr, "pKeyName", r->in.pKeyName);
    3923           4 :                 ndr->depth--;
    3924           4 :                 ndr_print_uint32(ndr, "cbEnumValues", r->in.cbEnumValues);
    3925           4 :                 ndr->depth--;
    3926             :         }
    3927           8 :         if (flags & NDR_OUT) {
    3928           4 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrinterDataEx");
    3929           4 :                 ndr->depth++;
    3930           4 :                 ndr_print_ptr(ndr, "pEnumValues", r->out.pEnumValues);
    3931           4 :                 ndr->depth++;
    3932           4 :                 ndr_print_array_uint8(ndr, "pEnumValues", r->out.pEnumValues, r->in.cbEnumValues);
    3933           4 :                 ndr->depth--;
    3934           4 :                 ndr_print_ptr(ndr, "pcbEnumValues", r->out.pcbEnumValues);
    3935           4 :                 ndr->depth++;
    3936           4 :                 ndr_print_uint32(ndr, "pcbEnumValues", *r->out.pcbEnumValues);
    3937           4 :                 ndr->depth--;
    3938           4 :                 ndr_print_ptr(ndr, "pnEnumValues", r->out.pnEnumValues);
    3939           4 :                 ndr->depth++;
    3940           4 :                 ndr_print_uint32(ndr, "pnEnumValues", *r->out.pnEnumValues);
    3941           4 :                 ndr->depth--;
    3942           4 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    3943           4 :                 ndr->depth--;
    3944             :         }
    3945           8 :         ndr->depth--;
    3946             : }
    3947             : 
    3948           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncEnumPrinterKey(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrinterKey *r)
    3949             : {
    3950             :         uint32_t cntr_pSubkey_1;
    3951           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    3952           0 :         if (flags & NDR_IN) {
    3953           0 :                 if (r->in.pKeyName == NULL) {
    3954           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3955             :                 }
    3956           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3957           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    3958           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    3959           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    3960           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pKeyName, ndr_charset_length(r->in.pKeyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    3961           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbSubkey));
    3962             :         }
    3963           0 :         if (flags & NDR_OUT) {
    3964           0 :                 if (r->out.pSubkey == NULL) {
    3965           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3966             :                 }
    3967           0 :                 if (r->out.pcbSubkey == NULL) {
    3968           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    3969             :                 }
    3970           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbSubkey / 2));
    3971           0 :                 for (cntr_pSubkey_1 = 0; cntr_pSubkey_1 < (r->in.cbSubkey / 2); cntr_pSubkey_1++) {
    3972           0 :                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.pSubkey[cntr_pSubkey_1]));
    3973             :                 }
    3974           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbSubkey));
    3975           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    3976             :         }
    3977           0 :         return NDR_ERR_SUCCESS;
    3978             : }
    3979             : 
    3980           8 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncEnumPrinterKey(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrinterKey *r)
    3981             : {
    3982           8 :         uint32_t size_pKeyName_1 = 0;
    3983           8 :         uint32_t length_pKeyName_1 = 0;
    3984           8 :         uint32_t size_pSubkey_1 = 0;
    3985             :         uint32_t cntr_pSubkey_1;
    3986           8 :         TALLOC_CTX *_mem_save_pSubkey_1 = NULL;
    3987           8 :         TALLOC_CTX *_mem_save_pcbSubkey_0 = NULL;
    3988           8 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    3989           8 :         if (flags & NDR_IN) {
    3990           4 :                 NDR_ZERO_STRUCT(r->out);
    3991             : 
    3992           4 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    3993           4 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pKeyName));
    3994           4 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pKeyName));
    3995           4 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pKeyName, &size_pKeyName_1));
    3996           4 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pKeyName, &length_pKeyName_1));
    3997           4 :                 if (length_pKeyName_1 > size_pKeyName_1) {
    3998           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pKeyName_1, length_pKeyName_1);
    3999             :                 }
    4000           4 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pKeyName_1, sizeof(uint16_t)));
    4001           4 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pKeyName, length_pKeyName_1, sizeof(uint16_t), CH_UTF16));
    4002           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbSubkey));
    4003           4 :                 NDR_PULL_ALLOC_N(ndr, r->out.pSubkey, r->in.cbSubkey / 2);
    4004           8 :                 memset(r->out.pSubkey, 0, (r->in.cbSubkey / 2) * sizeof(*r->out.pSubkey));
    4005           4 :                 NDR_PULL_ALLOC(ndr, r->out.pcbSubkey);
    4006           4 :                 NDR_ZERO_STRUCTP(r->out.pcbSubkey);
    4007             :         }
    4008           8 :         if (flags & NDR_OUT) {
    4009             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4010             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4011           4 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pSubkey));
    4012           4 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pSubkey, &size_pSubkey_1));
    4013           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4014           4 :                         NDR_PULL_ALLOC_N(ndr, r->out.pSubkey, size_pSubkey_1);
    4015             :                 }
    4016           4 :                 _mem_save_pSubkey_1 = NDR_PULL_GET_MEM_CTX(ndr);
    4017           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pSubkey, 0);
    4018           4 :                 for (cntr_pSubkey_1 = 0; cntr_pSubkey_1 < (size_pSubkey_1); cntr_pSubkey_1++) {
    4019           0 :                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.pSubkey[cntr_pSubkey_1]));
    4020             :                 }
    4021           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pSubkey_1, 0);
    4022           4 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4023           4 :                         NDR_PULL_ALLOC(ndr, r->out.pcbSubkey);
    4024             :                 }
    4025           4 :                 _mem_save_pcbSubkey_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4026           4 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbSubkey, LIBNDR_FLAG_REF_ALLOC);
    4027           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbSubkey));
    4028           4 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbSubkey_0, LIBNDR_FLAG_REF_ALLOC);
    4029           4 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4030           4 :                 if (r->out.pSubkey) {
    4031           4 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pSubkey, r->in.cbSubkey / 2));
    4032             :                 }
    4033             :         }
    4034           0 :         return NDR_ERR_SUCCESS;
    4035             : }
    4036             : 
    4037           8 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrinterKey(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrinterKey *r)
    4038             : {
    4039             :         uint32_t cntr_pSubkey_1;
    4040           8 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrinterKey");
    4041           8 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4042           8 :         ndr->depth++;
    4043           8 :         if (flags & NDR_SET_VALUES) {
    4044           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4045             :         }
    4046           8 :         if (flags & NDR_IN) {
    4047           4 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrinterKey");
    4048           4 :                 ndr->depth++;
    4049           4 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    4050           4 :                 ndr_print_ptr(ndr, "pKeyName", r->in.pKeyName);
    4051           4 :                 ndr->depth++;
    4052           4 :                 ndr_print_string(ndr, "pKeyName", r->in.pKeyName);
    4053           4 :                 ndr->depth--;
    4054           4 :                 ndr_print_uint32(ndr, "cbSubkey", r->in.cbSubkey);
    4055           4 :                 ndr->depth--;
    4056             :         }
    4057           8 :         if (flags & NDR_OUT) {
    4058           4 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrinterKey");
    4059           4 :                 ndr->depth++;
    4060           4 :                 ndr_print_ptr(ndr, "pSubkey", r->out.pSubkey);
    4061           4 :                 ndr->depth++;
    4062           4 :                 ndr->print(ndr, "%s: ARRAY(%d)", "pSubkey", (int)r->in.cbSubkey / 2);
    4063           4 :                 ndr->depth++;
    4064           4 :                 for (cntr_pSubkey_1 = 0; cntr_pSubkey_1 < (r->in.cbSubkey / 2); cntr_pSubkey_1++) {
    4065           0 :                         ndr_print_uint16(ndr, "pSubkey", r->out.pSubkey[cntr_pSubkey_1]);
    4066             :                 }
    4067           4 :                 ndr->depth--;
    4068           4 :                 ndr->depth--;
    4069           4 :                 ndr_print_ptr(ndr, "pcbSubkey", r->out.pcbSubkey);
    4070           4 :                 ndr->depth++;
    4071           4 :                 ndr_print_uint32(ndr, "pcbSubkey", *r->out.pcbSubkey);
    4072           4 :                 ndr->depth--;
    4073           4 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4074           4 :                 ndr->depth--;
    4075             :         }
    4076           8 :         ndr->depth--;
    4077             : }
    4078             : 
    4079           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinterData(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinterData *r)
    4080             : {
    4081           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4082           0 :         if (flags & NDR_IN) {
    4083           0 :                 if (r->in.pValueName == NULL) {
    4084           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4085             :                 }
    4086           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4087           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    4088           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4089           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    4090           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pValueName, ndr_charset_length(r->in.pValueName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4091             :         }
    4092           0 :         if (flags & NDR_OUT) {
    4093           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4094             :         }
    4095           0 :         return NDR_ERR_SUCCESS;
    4096             : }
    4097             : 
    4098           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinterData(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinterData *r)
    4099             : {
    4100           0 :         uint32_t size_pValueName_1 = 0;
    4101           0 :         uint32_t length_pValueName_1 = 0;
    4102           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4103           0 :         if (flags & NDR_IN) {
    4104           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4105           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pValueName));
    4106           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pValueName));
    4107           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pValueName, &size_pValueName_1));
    4108           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pValueName, &length_pValueName_1));
    4109           0 :                 if (length_pValueName_1 > size_pValueName_1) {
    4110           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pValueName_1, length_pValueName_1);
    4111             :                 }
    4112           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pValueName_1, sizeof(uint16_t)));
    4113           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pValueName, length_pValueName_1, sizeof(uint16_t), CH_UTF16));
    4114             :         }
    4115           0 :         if (flags & NDR_OUT) {
    4116             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4117             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4118           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4119             :         }
    4120           0 :         return NDR_ERR_SUCCESS;
    4121             : }
    4122             : 
    4123           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinterData(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinterData *r)
    4124             : {
    4125           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinterData");
    4126           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4127           0 :         ndr->depth++;
    4128           0 :         if (flags & NDR_SET_VALUES) {
    4129           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4130             :         }
    4131           0 :         if (flags & NDR_IN) {
    4132           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinterData");
    4133           0 :                 ndr->depth++;
    4134           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    4135           0 :                 ndr_print_ptr(ndr, "pValueName", r->in.pValueName);
    4136           0 :                 ndr->depth++;
    4137           0 :                 ndr_print_string(ndr, "pValueName", r->in.pValueName);
    4138           0 :                 ndr->depth--;
    4139           0 :                 ndr->depth--;
    4140             :         }
    4141           0 :         if (flags & NDR_OUT) {
    4142           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinterData");
    4143           0 :                 ndr->depth++;
    4144           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4145           0 :                 ndr->depth--;
    4146             :         }
    4147           0 :         ndr->depth--;
    4148             : }
    4149             : 
    4150           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinterDataEx(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinterDataEx *r)
    4151             : {
    4152           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4153           0 :         if (flags & NDR_IN) {
    4154           0 :                 if (r->in.pKeyName == NULL) {
    4155           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4156             :                 }
    4157           0 :                 if (r->in.pValueName == NULL) {
    4158           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4159             :                 }
    4160           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4161           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    4162           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4163           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    4164           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pKeyName, ndr_charset_length(r->in.pKeyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4165           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    4166           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4167           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pValueName, CH_UTF16)));
    4168           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pValueName, ndr_charset_length(r->in.pValueName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4169             :         }
    4170           0 :         if (flags & NDR_OUT) {
    4171           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4172             :         }
    4173           0 :         return NDR_ERR_SUCCESS;
    4174             : }
    4175             : 
    4176           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinterDataEx(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinterDataEx *r)
    4177             : {
    4178           0 :         uint32_t size_pKeyName_1 = 0;
    4179           0 :         uint32_t length_pKeyName_1 = 0;
    4180           0 :         uint32_t size_pValueName_1 = 0;
    4181           0 :         uint32_t length_pValueName_1 = 0;
    4182           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4183           0 :         if (flags & NDR_IN) {
    4184           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4185           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pKeyName));
    4186           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pKeyName));
    4187           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pKeyName, &size_pKeyName_1));
    4188           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pKeyName, &length_pKeyName_1));
    4189           0 :                 if (length_pKeyName_1 > size_pKeyName_1) {
    4190           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pKeyName_1, length_pKeyName_1);
    4191             :                 }
    4192           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pKeyName_1, sizeof(uint16_t)));
    4193           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pKeyName, length_pKeyName_1, sizeof(uint16_t), CH_UTF16));
    4194           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pValueName));
    4195           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pValueName));
    4196           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pValueName, &size_pValueName_1));
    4197           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pValueName, &length_pValueName_1));
    4198           0 :                 if (length_pValueName_1 > size_pValueName_1) {
    4199           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pValueName_1, length_pValueName_1);
    4200             :                 }
    4201           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pValueName_1, sizeof(uint16_t)));
    4202           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pValueName, length_pValueName_1, sizeof(uint16_t), CH_UTF16));
    4203             :         }
    4204           0 :         if (flags & NDR_OUT) {
    4205             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4206             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4207           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4208             :         }
    4209           0 :         return NDR_ERR_SUCCESS;
    4210             : }
    4211             : 
    4212           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinterDataEx *r)
    4213             : {
    4214           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinterDataEx");
    4215           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4216           0 :         ndr->depth++;
    4217           0 :         if (flags & NDR_SET_VALUES) {
    4218           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4219             :         }
    4220           0 :         if (flags & NDR_IN) {
    4221           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinterDataEx");
    4222           0 :                 ndr->depth++;
    4223           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    4224           0 :                 ndr_print_ptr(ndr, "pKeyName", r->in.pKeyName);
    4225           0 :                 ndr->depth++;
    4226           0 :                 ndr_print_string(ndr, "pKeyName", r->in.pKeyName);
    4227           0 :                 ndr->depth--;
    4228           0 :                 ndr_print_ptr(ndr, "pValueName", r->in.pValueName);
    4229           0 :                 ndr->depth++;
    4230           0 :                 ndr_print_string(ndr, "pValueName", r->in.pValueName);
    4231           0 :                 ndr->depth--;
    4232           0 :                 ndr->depth--;
    4233             :         }
    4234           0 :         if (flags & NDR_OUT) {
    4235           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinterDataEx");
    4236           0 :                 ndr->depth++;
    4237           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4238           0 :                 ndr->depth--;
    4239             :         }
    4240           0 :         ndr->depth--;
    4241             : }
    4242             : 
    4243           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinterKey(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinterKey *r)
    4244             : {
    4245           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4246           0 :         if (flags & NDR_IN) {
    4247           0 :                 if (r->in.pKeyName == NULL) {
    4248           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4249             :                 }
    4250           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4251           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    4252           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4253           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pKeyName, CH_UTF16)));
    4254           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pKeyName, ndr_charset_length(r->in.pKeyName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4255             :         }
    4256           0 :         if (flags & NDR_OUT) {
    4257           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4258             :         }
    4259           0 :         return NDR_ERR_SUCCESS;
    4260             : }
    4261             : 
    4262           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinterKey(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinterKey *r)
    4263             : {
    4264           0 :         uint32_t size_pKeyName_1 = 0;
    4265           0 :         uint32_t length_pKeyName_1 = 0;
    4266           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4267           0 :         if (flags & NDR_IN) {
    4268           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4269           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pKeyName));
    4270           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pKeyName));
    4271           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pKeyName, &size_pKeyName_1));
    4272           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pKeyName, &length_pKeyName_1));
    4273           0 :                 if (length_pKeyName_1 > size_pKeyName_1) {
    4274           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pKeyName_1, length_pKeyName_1);
    4275             :                 }
    4276           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pKeyName_1, sizeof(uint16_t)));
    4277           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pKeyName, length_pKeyName_1, sizeof(uint16_t), CH_UTF16));
    4278             :         }
    4279           0 :         if (flags & NDR_OUT) {
    4280             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4281             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4282           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4283             :         }
    4284           0 :         return NDR_ERR_SUCCESS;
    4285             : }
    4286             : 
    4287           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinterKey(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinterKey *r)
    4288             : {
    4289           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinterKey");
    4290           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4291           0 :         ndr->depth++;
    4292           0 :         if (flags & NDR_SET_VALUES) {
    4293           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4294             :         }
    4295           0 :         if (flags & NDR_IN) {
    4296           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinterKey");
    4297           0 :                 ndr->depth++;
    4298           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    4299           0 :                 ndr_print_ptr(ndr, "pKeyName", r->in.pKeyName);
    4300           0 :                 ndr->depth++;
    4301           0 :                 ndr_print_string(ndr, "pKeyName", r->in.pKeyName);
    4302           0 :                 ndr->depth--;
    4303           0 :                 ndr->depth--;
    4304             :         }
    4305           0 :         if (flags & NDR_OUT) {
    4306           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinterKey");
    4307           0 :                 ndr->depth++;
    4308           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4309           0 :                 ndr->depth--;
    4310             :         }
    4311           0 :         ndr->depth--;
    4312             : }
    4313             : 
    4314           0 : static enum ndr_err_code ndr_push_winspool_AsyncXcvData(struct ndr_push *ndr, int flags, const struct winspool_AsyncXcvData *r)
    4315             : {
    4316           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4317           0 :         if (flags & NDR_IN) {
    4318           0 :                 if (r->in.pszDataName == NULL) {
    4319           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4320             :                 }
    4321           0 :                 if (r->in.pInputData == NULL) {
    4322           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4323             :                 }
    4324           0 :                 if (r->in.pdwStatus == NULL) {
    4325           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4326             :                 }
    4327           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hXcv));
    4328           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pszDataName, CH_UTF16)));
    4329           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4330           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pszDataName, CH_UTF16)));
    4331           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pszDataName, ndr_charset_length(r->in.pszDataName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4332           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbInputData));
    4333           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pInputData, r->in.cbInputData));
    4334           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbInputData));
    4335           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbOutputData));
    4336           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.pdwStatus));
    4337             :         }
    4338           0 :         if (flags & NDR_OUT) {
    4339           0 :                 if (r->out.pOutputData == NULL) {
    4340           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4341             :                 }
    4342           0 :                 if (r->out.pcbOutputNeeded == NULL) {
    4343           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4344             :                 }
    4345           0 :                 if (r->out.pdwStatus == NULL) {
    4346           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4347             :                 }
    4348           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbOutputData));
    4349           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pOutputData, r->in.cbOutputData));
    4350           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbOutputNeeded));
    4351           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pdwStatus));
    4352           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4353             :         }
    4354           0 :         return NDR_ERR_SUCCESS;
    4355             : }
    4356             : 
    4357           0 : static enum ndr_err_code ndr_pull_winspool_AsyncXcvData(struct ndr_pull *ndr, int flags, struct winspool_AsyncXcvData *r)
    4358             : {
    4359           0 :         uint32_t size_pszDataName_1 = 0;
    4360           0 :         uint32_t length_pszDataName_1 = 0;
    4361           0 :         uint32_t size_pInputData_1 = 0;
    4362           0 :         uint32_t size_pOutputData_1 = 0;
    4363           0 :         TALLOC_CTX *_mem_save_pcbOutputNeeded_0 = NULL;
    4364           0 :         TALLOC_CTX *_mem_save_pdwStatus_0 = NULL;
    4365           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4366           0 :         if (flags & NDR_IN) {
    4367           0 :                 NDR_ZERO_STRUCT(r->out);
    4368             : 
    4369           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hXcv));
    4370           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pszDataName));
    4371           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pszDataName));
    4372           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pszDataName, &size_pszDataName_1));
    4373           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pszDataName, &length_pszDataName_1));
    4374           0 :                 if (length_pszDataName_1 > size_pszDataName_1) {
    4375           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pszDataName_1, length_pszDataName_1);
    4376             :                 }
    4377           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pszDataName_1, sizeof(uint16_t)));
    4378           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pszDataName, length_pszDataName_1, sizeof(uint16_t), CH_UTF16));
    4379           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pInputData));
    4380           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pInputData, &size_pInputData_1));
    4381           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4382           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pInputData, size_pInputData_1);
    4383             :                 }
    4384           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pInputData, size_pInputData_1));
    4385           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbInputData));
    4386           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbOutputData));
    4387           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4388           0 :                         NDR_PULL_ALLOC(ndr, r->in.pdwStatus);
    4389             :                 }
    4390           0 :                 _mem_save_pdwStatus_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4391           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pdwStatus, LIBNDR_FLAG_REF_ALLOC);
    4392           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->in.pdwStatus));
    4393           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pdwStatus_0, LIBNDR_FLAG_REF_ALLOC);
    4394           0 :                 NDR_PULL_ALLOC_N(ndr, r->out.pOutputData, r->in.cbOutputData);
    4395           0 :                 memset(r->out.pOutputData, 0, (r->in.cbOutputData) * sizeof(*r->out.pOutputData));
    4396           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbOutputNeeded);
    4397           0 :                 NDR_ZERO_STRUCTP(r->out.pcbOutputNeeded);
    4398           0 :                 NDR_PULL_ALLOC(ndr, r->out.pdwStatus);
    4399           0 :                 *r->out.pdwStatus = *r->in.pdwStatus;
    4400           0 :                 if (r->in.pInputData) {
    4401           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pInputData, r->in.cbInputData));
    4402             :                 }
    4403             :         }
    4404           0 :         if (flags & NDR_OUT) {
    4405             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4406             :                 if (r->in.pdwStatus == NULL) {
    4407             :                         NDR_PULL_ALLOC(ndr, r->in.pdwStatus);
    4408             :                         NDR_ZERO_STRUCTP(r->in.pdwStatus);
    4409             :                 }
    4410             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4411           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pOutputData));
    4412           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pOutputData, &size_pOutputData_1));
    4413           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4414           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pOutputData, size_pOutputData_1);
    4415             :                 }
    4416           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pOutputData, size_pOutputData_1));
    4417           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4418           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbOutputNeeded);
    4419             :                 }
    4420           0 :                 _mem_save_pcbOutputNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4421           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbOutputNeeded, LIBNDR_FLAG_REF_ALLOC);
    4422           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbOutputNeeded));
    4423           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbOutputNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    4424           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4425           0 :                         NDR_PULL_ALLOC(ndr, r->out.pdwStatus);
    4426             :                 }
    4427           0 :                 _mem_save_pdwStatus_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4428           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pdwStatus, LIBNDR_FLAG_REF_ALLOC);
    4429           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pdwStatus));
    4430           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pdwStatus_0, LIBNDR_FLAG_REF_ALLOC);
    4431           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4432           0 :                 if (r->out.pOutputData) {
    4433           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pOutputData, r->in.cbOutputData));
    4434             :                 }
    4435             :         }
    4436           0 :         return NDR_ERR_SUCCESS;
    4437             : }
    4438             : 
    4439           0 : _PUBLIC_ void ndr_print_winspool_AsyncXcvData(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncXcvData *r)
    4440             : {
    4441           0 :         ndr_print_struct(ndr, name, "winspool_AsyncXcvData");
    4442           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4443           0 :         ndr->depth++;
    4444           0 :         if (flags & NDR_SET_VALUES) {
    4445           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4446             :         }
    4447           0 :         if (flags & NDR_IN) {
    4448           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncXcvData");
    4449           0 :                 ndr->depth++;
    4450           0 :                 ndr_print_policy_handle(ndr, "hXcv", &r->in.hXcv);
    4451           0 :                 ndr_print_ptr(ndr, "pszDataName", r->in.pszDataName);
    4452           0 :                 ndr->depth++;
    4453           0 :                 ndr_print_string(ndr, "pszDataName", r->in.pszDataName);
    4454           0 :                 ndr->depth--;
    4455           0 :                 ndr_print_ptr(ndr, "pInputData", r->in.pInputData);
    4456           0 :                 ndr->depth++;
    4457           0 :                 ndr_print_array_uint8(ndr, "pInputData", r->in.pInputData, r->in.cbInputData);
    4458           0 :                 ndr->depth--;
    4459           0 :                 ndr_print_uint32(ndr, "cbInputData", r->in.cbInputData);
    4460           0 :                 ndr_print_uint32(ndr, "cbOutputData", r->in.cbOutputData);
    4461           0 :                 ndr_print_ptr(ndr, "pdwStatus", r->in.pdwStatus);
    4462           0 :                 ndr->depth++;
    4463           0 :                 ndr_print_uint32(ndr, "pdwStatus", *r->in.pdwStatus);
    4464           0 :                 ndr->depth--;
    4465           0 :                 ndr->depth--;
    4466             :         }
    4467           0 :         if (flags & NDR_OUT) {
    4468           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncXcvData");
    4469           0 :                 ndr->depth++;
    4470           0 :                 ndr_print_ptr(ndr, "pOutputData", r->out.pOutputData);
    4471           0 :                 ndr->depth++;
    4472           0 :                 ndr_print_array_uint8(ndr, "pOutputData", r->out.pOutputData, r->in.cbOutputData);
    4473           0 :                 ndr->depth--;
    4474           0 :                 ndr_print_ptr(ndr, "pcbOutputNeeded", r->out.pcbOutputNeeded);
    4475           0 :                 ndr->depth++;
    4476           0 :                 ndr_print_uint32(ndr, "pcbOutputNeeded", *r->out.pcbOutputNeeded);
    4477           0 :                 ndr->depth--;
    4478           0 :                 ndr_print_ptr(ndr, "pdwStatus", r->out.pdwStatus);
    4479           0 :                 ndr->depth++;
    4480           0 :                 ndr_print_uint32(ndr, "pdwStatus", *r->out.pdwStatus);
    4481           0 :                 ndr->depth--;
    4482           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4483           0 :                 ndr->depth--;
    4484             :         }
    4485           0 :         ndr->depth--;
    4486             : }
    4487             : 
    4488           0 : static enum ndr_err_code ndr_push_winspool_AsyncSendRecvBidiData(struct ndr_push *ndr, int flags, const struct winspool_AsyncSendRecvBidiData *r)
    4489             : {
    4490           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4491           0 :         if (flags & NDR_IN) {
    4492           0 :                 if (r->in.pReqData == NULL) {
    4493           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4494             :                 }
    4495           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4496           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pAction));
    4497           0 :                 if (r->in.pAction) {
    4498           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pAction, CH_UTF16)));
    4499           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4500           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pAction, CH_UTF16)));
    4501           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pAction, ndr_charset_length(r->in.pAction, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4502             :                 }
    4503           0 :                 NDR_CHECK(ndr_push_RPC_BIDI_REQUEST_CONTAINER(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pReqData));
    4504             :         }
    4505           0 :         if (flags & NDR_OUT) {
    4506           0 :                 if (r->out.ppRespData == NULL) {
    4507           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4508             :                 }
    4509           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.ppRespData));
    4510           0 :                 if (*r->out.ppRespData) {
    4511           0 :                         NDR_CHECK(ndr_push_RPC_BIDI_RESPONSE_CONTAINER(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ppRespData));
    4512             :                 }
    4513           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4514             :         }
    4515           0 :         return NDR_ERR_SUCCESS;
    4516             : }
    4517             : 
    4518           0 : static enum ndr_err_code ndr_pull_winspool_AsyncSendRecvBidiData(struct ndr_pull *ndr, int flags, struct winspool_AsyncSendRecvBidiData *r)
    4519             : {
    4520             :         uint32_t _ptr_pAction;
    4521           0 :         uint32_t size_pAction_1 = 0;
    4522           0 :         uint32_t length_pAction_1 = 0;
    4523             :         uint32_t _ptr_ppRespData;
    4524           0 :         TALLOC_CTX *_mem_save_pAction_0 = NULL;
    4525           0 :         TALLOC_CTX *_mem_save_pReqData_0 = NULL;
    4526           0 :         TALLOC_CTX *_mem_save_ppRespData_0 = NULL;
    4527           0 :         TALLOC_CTX *_mem_save_ppRespData_1 = NULL;
    4528           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4529           0 :         if (flags & NDR_IN) {
    4530           0 :                 NDR_ZERO_STRUCT(r->out);
    4531             : 
    4532           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4533           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pAction));
    4534           0 :                 if (_ptr_pAction) {
    4535           0 :                         NDR_PULL_ALLOC(ndr, r->in.pAction);
    4536             :                 } else {
    4537           0 :                         r->in.pAction = NULL;
    4538             :                 }
    4539           0 :                 if (r->in.pAction) {
    4540           0 :                         _mem_save_pAction_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4541           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pAction, 0);
    4542           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pAction));
    4543           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pAction));
    4544           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pAction, &size_pAction_1));
    4545           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pAction, &length_pAction_1));
    4546           0 :                         if (length_pAction_1 > size_pAction_1) {
    4547           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pAction_1, length_pAction_1);
    4548             :                         }
    4549           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pAction_1, sizeof(uint16_t)));
    4550           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pAction, length_pAction_1, sizeof(uint16_t), CH_UTF16));
    4551           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pAction_0, 0);
    4552             :                 }
    4553           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4554           0 :                         NDR_PULL_ALLOC(ndr, r->in.pReqData);
    4555             :                 }
    4556           0 :                 _mem_save_pReqData_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4557           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pReqData, LIBNDR_FLAG_REF_ALLOC);
    4558           0 :                 NDR_CHECK(ndr_pull_RPC_BIDI_REQUEST_CONTAINER(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pReqData));
    4559           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pReqData_0, LIBNDR_FLAG_REF_ALLOC);
    4560           0 :                 NDR_PULL_ALLOC(ndr, r->out.ppRespData);
    4561           0 :                 NDR_ZERO_STRUCTP(r->out.ppRespData);
    4562             :         }
    4563           0 :         if (flags & NDR_OUT) {
    4564             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4565             :                 if (r->in.pReqData == NULL) {
    4566             :                         NDR_PULL_ALLOC(ndr, r->in.pReqData);
    4567             :                         NDR_ZERO_STRUCTP(r->in.pReqData);
    4568             :                 }
    4569             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4570           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4571           0 :                         NDR_PULL_ALLOC(ndr, r->out.ppRespData);
    4572             :                 }
    4573           0 :                 _mem_save_ppRespData_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4574           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.ppRespData, LIBNDR_FLAG_REF_ALLOC);
    4575           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ppRespData));
    4576           0 :                 if (_ptr_ppRespData) {
    4577           0 :                         NDR_PULL_ALLOC(ndr, *r->out.ppRespData);
    4578             :                 } else {
    4579           0 :                         *r->out.ppRespData = NULL;
    4580             :                 }
    4581           0 :                 if (*r->out.ppRespData) {
    4582           0 :                         _mem_save_ppRespData_1 = NDR_PULL_GET_MEM_CTX(ndr);
    4583           0 :                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.ppRespData, 0);
    4584           0 :                         NDR_CHECK(ndr_pull_RPC_BIDI_RESPONSE_CONTAINER(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.ppRespData));
    4585           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ppRespData_1, 0);
    4586             :                 }
    4587           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ppRespData_0, LIBNDR_FLAG_REF_ALLOC);
    4588           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4589             :         }
    4590           0 :         return NDR_ERR_SUCCESS;
    4591             : }
    4592             : 
    4593           0 : _PUBLIC_ void ndr_print_winspool_AsyncSendRecvBidiData(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSendRecvBidiData *r)
    4594             : {
    4595           0 :         ndr_print_struct(ndr, name, "winspool_AsyncSendRecvBidiData");
    4596           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4597           0 :         ndr->depth++;
    4598           0 :         if (flags & NDR_SET_VALUES) {
    4599           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4600             :         }
    4601           0 :         if (flags & NDR_IN) {
    4602           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSendRecvBidiData");
    4603           0 :                 ndr->depth++;
    4604           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    4605           0 :                 ndr_print_ptr(ndr, "pAction", r->in.pAction);
    4606           0 :                 ndr->depth++;
    4607           0 :                 if (r->in.pAction) {
    4608           0 :                         ndr_print_string(ndr, "pAction", r->in.pAction);
    4609             :                 }
    4610           0 :                 ndr->depth--;
    4611           0 :                 ndr_print_ptr(ndr, "pReqData", r->in.pReqData);
    4612           0 :                 ndr->depth++;
    4613           0 :                 ndr_print_RPC_BIDI_REQUEST_CONTAINER(ndr, "pReqData", r->in.pReqData);
    4614           0 :                 ndr->depth--;
    4615           0 :                 ndr->depth--;
    4616             :         }
    4617           0 :         if (flags & NDR_OUT) {
    4618           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSendRecvBidiData");
    4619           0 :                 ndr->depth++;
    4620           0 :                 ndr_print_ptr(ndr, "ppRespData", r->out.ppRespData);
    4621           0 :                 ndr->depth++;
    4622           0 :                 ndr_print_ptr(ndr, "ppRespData", *r->out.ppRespData);
    4623           0 :                 ndr->depth++;
    4624           0 :                 if (*r->out.ppRespData) {
    4625           0 :                         ndr_print_RPC_BIDI_RESPONSE_CONTAINER(ndr, "ppRespData", *r->out.ppRespData);
    4626             :                 }
    4627           0 :                 ndr->depth--;
    4628           0 :                 ndr->depth--;
    4629           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4630           0 :                 ndr->depth--;
    4631             :         }
    4632           0 :         ndr->depth--;
    4633             : }
    4634             : 
    4635           0 : static enum ndr_err_code ndr_push_winspool_AsyncCreatePrinterIC(struct ndr_push *ndr, int flags, const struct winspool_AsyncCreatePrinterIC *r)
    4636             : {
    4637           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4638           0 :         if (flags & NDR_IN) {
    4639           0 :                 if (r->in.pDevModeContainer == NULL) {
    4640           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4641             :                 }
    4642           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4643           0 :                 NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
    4644             :         }
    4645           0 :         if (flags & NDR_OUT) {
    4646           0 :                 if (r->out.pHandle == NULL) {
    4647           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4648             :                 }
    4649           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.pHandle));
    4650           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4651             :         }
    4652           0 :         return NDR_ERR_SUCCESS;
    4653             : }
    4654             : 
    4655           0 : static enum ndr_err_code ndr_pull_winspool_AsyncCreatePrinterIC(struct ndr_pull *ndr, int flags, struct winspool_AsyncCreatePrinterIC *r)
    4656             : {
    4657           0 :         TALLOC_CTX *_mem_save_pHandle_0 = NULL;
    4658           0 :         TALLOC_CTX *_mem_save_pDevModeContainer_0 = NULL;
    4659           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4660           0 :         if (flags & NDR_IN) {
    4661           0 :                 NDR_ZERO_STRUCT(r->out);
    4662             : 
    4663           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinter));
    4664           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4665           0 :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
    4666             :                 }
    4667           0 :                 _mem_save_pDevModeContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4668           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pDevModeContainer, LIBNDR_FLAG_REF_ALLOC);
    4669           0 :                 NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDevModeContainer));
    4670           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDevModeContainer_0, LIBNDR_FLAG_REF_ALLOC);
    4671           0 :                 NDR_PULL_ALLOC(ndr, r->out.pHandle);
    4672           0 :                 NDR_ZERO_STRUCTP(r->out.pHandle);
    4673             :         }
    4674           0 :         if (flags & NDR_OUT) {
    4675             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4676             :                 if (r->in.pDevModeContainer == NULL) {
    4677             :                         NDR_PULL_ALLOC(ndr, r->in.pDevModeContainer);
    4678             :                         NDR_ZERO_STRUCTP(r->in.pDevModeContainer);
    4679             :                 }
    4680             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4681           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4682           0 :                         NDR_PULL_ALLOC(ndr, r->out.pHandle);
    4683             :                 }
    4684           0 :                 _mem_save_pHandle_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4685           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pHandle, LIBNDR_FLAG_REF_ALLOC);
    4686           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.pHandle));
    4687           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pHandle_0, LIBNDR_FLAG_REF_ALLOC);
    4688           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4689             :         }
    4690           0 :         return NDR_ERR_SUCCESS;
    4691             : }
    4692             : 
    4693           0 : _PUBLIC_ void ndr_print_winspool_AsyncCreatePrinterIC(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncCreatePrinterIC *r)
    4694             : {
    4695           0 :         ndr_print_struct(ndr, name, "winspool_AsyncCreatePrinterIC");
    4696           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4697           0 :         ndr->depth++;
    4698           0 :         if (flags & NDR_SET_VALUES) {
    4699           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4700             :         }
    4701           0 :         if (flags & NDR_IN) {
    4702           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncCreatePrinterIC");
    4703           0 :                 ndr->depth++;
    4704           0 :                 ndr_print_policy_handle(ndr, "hPrinter", &r->in.hPrinter);
    4705           0 :                 ndr_print_ptr(ndr, "pDevModeContainer", r->in.pDevModeContainer);
    4706           0 :                 ndr->depth++;
    4707           0 :                 ndr_print_spoolss_DevmodeContainer(ndr, "pDevModeContainer", r->in.pDevModeContainer);
    4708           0 :                 ndr->depth--;
    4709           0 :                 ndr->depth--;
    4710             :         }
    4711           0 :         if (flags & NDR_OUT) {
    4712           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncCreatePrinterIC");
    4713           0 :                 ndr->depth++;
    4714           0 :                 ndr_print_ptr(ndr, "pHandle", r->out.pHandle);
    4715           0 :                 ndr->depth++;
    4716           0 :                 ndr_print_policy_handle(ndr, "pHandle", r->out.pHandle);
    4717           0 :                 ndr->depth--;
    4718           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4719           0 :                 ndr->depth--;
    4720             :         }
    4721           0 :         ndr->depth--;
    4722             : }
    4723             : 
    4724           0 : static enum ndr_err_code ndr_push_winspool_AsyncPlayGdiScriptOnPrinterIC(struct ndr_push *ndr, int flags, const struct winspool_AsyncPlayGdiScriptOnPrinterIC *r)
    4725             : {
    4726           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4727           0 :         if (flags & NDR_IN) {
    4728           0 :                 if (r->in.pIn == NULL) {
    4729           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4730             :                 }
    4731           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinterIC));
    4732           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cIn));
    4733           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pIn, r->in.cIn));
    4734           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cIn));
    4735           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cOut));
    4736           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.ul));
    4737             :         }
    4738           0 :         if (flags & NDR_OUT) {
    4739           0 :                 if (r->out.pOut == NULL) {
    4740           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4741             :                 }
    4742           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cOut));
    4743           0 :                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pOut, r->in.cOut));
    4744           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4745             :         }
    4746           0 :         return NDR_ERR_SUCCESS;
    4747             : }
    4748             : 
    4749           0 : static enum ndr_err_code ndr_pull_winspool_AsyncPlayGdiScriptOnPrinterIC(struct ndr_pull *ndr, int flags, struct winspool_AsyncPlayGdiScriptOnPrinterIC *r)
    4750             : {
    4751           0 :         uint32_t size_pIn_1 = 0;
    4752           0 :         uint32_t size_pOut_1 = 0;
    4753           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4754           0 :         if (flags & NDR_IN) {
    4755           0 :                 NDR_ZERO_STRUCT(r->out);
    4756             : 
    4757           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.hPrinterIC));
    4758           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pIn));
    4759           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pIn, &size_pIn_1));
    4760           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4761           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pIn, size_pIn_1);
    4762             :                 }
    4763           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pIn, size_pIn_1));
    4764           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cIn));
    4765           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cOut));
    4766           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.ul));
    4767           0 :                 NDR_PULL_ALLOC_N(ndr, r->out.pOut, r->in.cOut);
    4768           0 :                 memset(r->out.pOut, 0, (r->in.cOut) * sizeof(*r->out.pOut));
    4769           0 :                 if (r->in.pIn) {
    4770           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pIn, r->in.cIn));
    4771             :                 }
    4772             :         }
    4773           0 :         if (flags & NDR_OUT) {
    4774             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4775             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4776           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pOut));
    4777           0 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pOut, &size_pOut_1));
    4778           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4779           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pOut, size_pOut_1);
    4780             :                 }
    4781           0 :                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pOut, size_pOut_1));
    4782           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4783           0 :                 if (r->out.pOut) {
    4784           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pOut, r->in.cOut));
    4785             :                 }
    4786             :         }
    4787           0 :         return NDR_ERR_SUCCESS;
    4788             : }
    4789             : 
    4790           0 : _PUBLIC_ void ndr_print_winspool_AsyncPlayGdiScriptOnPrinterIC(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncPlayGdiScriptOnPrinterIC *r)
    4791             : {
    4792           0 :         ndr_print_struct(ndr, name, "winspool_AsyncPlayGdiScriptOnPrinterIC");
    4793           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4794           0 :         ndr->depth++;
    4795           0 :         if (flags & NDR_SET_VALUES) {
    4796           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4797             :         }
    4798           0 :         if (flags & NDR_IN) {
    4799           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncPlayGdiScriptOnPrinterIC");
    4800           0 :                 ndr->depth++;
    4801           0 :                 ndr_print_policy_handle(ndr, "hPrinterIC", &r->in.hPrinterIC);
    4802           0 :                 ndr_print_ptr(ndr, "pIn", r->in.pIn);
    4803           0 :                 ndr->depth++;
    4804           0 :                 ndr_print_array_uint8(ndr, "pIn", r->in.pIn, r->in.cIn);
    4805           0 :                 ndr->depth--;
    4806           0 :                 ndr_print_uint32(ndr, "cIn", r->in.cIn);
    4807           0 :                 ndr_print_uint32(ndr, "cOut", r->in.cOut);
    4808           0 :                 ndr_print_uint32(ndr, "ul", r->in.ul);
    4809           0 :                 ndr->depth--;
    4810             :         }
    4811           0 :         if (flags & NDR_OUT) {
    4812           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncPlayGdiScriptOnPrinterIC");
    4813           0 :                 ndr->depth++;
    4814           0 :                 ndr_print_ptr(ndr, "pOut", r->out.pOut);
    4815           0 :                 ndr->depth++;
    4816           0 :                 ndr_print_array_uint8(ndr, "pOut", r->out.pOut, r->in.cOut);
    4817           0 :                 ndr->depth--;
    4818           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4819           0 :                 ndr->depth--;
    4820             :         }
    4821           0 :         ndr->depth--;
    4822             : }
    4823             : 
    4824           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinterIC(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinterIC *r)
    4825             : {
    4826           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4827           0 :         if (flags & NDR_IN) {
    4828           0 :                 if (r->in.phPrinterIC == NULL) {
    4829           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4830             :                 }
    4831           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.phPrinterIC));
    4832             :         }
    4833           0 :         if (flags & NDR_OUT) {
    4834           0 :                 if (r->out.phPrinterIC == NULL) {
    4835           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4836             :                 }
    4837           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.phPrinterIC));
    4838           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4839             :         }
    4840           0 :         return NDR_ERR_SUCCESS;
    4841             : }
    4842             : 
    4843           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinterIC(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinterIC *r)
    4844             : {
    4845           0 :         TALLOC_CTX *_mem_save_phPrinterIC_0 = NULL;
    4846           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4847           0 :         if (flags & NDR_IN) {
    4848           0 :                 NDR_ZERO_STRUCT(r->out);
    4849             : 
    4850           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4851           0 :                         NDR_PULL_ALLOC(ndr, r->in.phPrinterIC);
    4852             :                 }
    4853           0 :                 _mem_save_phPrinterIC_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4854           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.phPrinterIC, LIBNDR_FLAG_REF_ALLOC);
    4855           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.phPrinterIC));
    4856           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_phPrinterIC_0, LIBNDR_FLAG_REF_ALLOC);
    4857           0 :                 NDR_PULL_ALLOC(ndr, r->out.phPrinterIC);
    4858           0 :                 *r->out.phPrinterIC = *r->in.phPrinterIC;
    4859             :         }
    4860           0 :         if (flags & NDR_OUT) {
    4861             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    4862             :                 if (r->in.phPrinterIC == NULL) {
    4863             :                         NDR_PULL_ALLOC(ndr, r->in.phPrinterIC);
    4864             :                         NDR_ZERO_STRUCTP(r->in.phPrinterIC);
    4865             :                 }
    4866             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    4867           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    4868           0 :                         NDR_PULL_ALLOC(ndr, r->out.phPrinterIC);
    4869             :                 }
    4870           0 :                 _mem_save_phPrinterIC_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4871           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.phPrinterIC, LIBNDR_FLAG_REF_ALLOC);
    4872           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.phPrinterIC));
    4873           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_phPrinterIC_0, LIBNDR_FLAG_REF_ALLOC);
    4874           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    4875             :         }
    4876           0 :         return NDR_ERR_SUCCESS;
    4877             : }
    4878             : 
    4879           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinterIC(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinterIC *r)
    4880             : {
    4881           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinterIC");
    4882           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    4883           0 :         ndr->depth++;
    4884           0 :         if (flags & NDR_SET_VALUES) {
    4885           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    4886             :         }
    4887           0 :         if (flags & NDR_IN) {
    4888           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinterIC");
    4889           0 :                 ndr->depth++;
    4890           0 :                 ndr_print_ptr(ndr, "phPrinterIC", r->in.phPrinterIC);
    4891           0 :                 ndr->depth++;
    4892           0 :                 ndr_print_policy_handle(ndr, "phPrinterIC", r->in.phPrinterIC);
    4893           0 :                 ndr->depth--;
    4894           0 :                 ndr->depth--;
    4895             :         }
    4896           0 :         if (flags & NDR_OUT) {
    4897           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinterIC");
    4898           0 :                 ndr->depth++;
    4899           0 :                 ndr_print_ptr(ndr, "phPrinterIC", r->out.phPrinterIC);
    4900           0 :                 ndr->depth++;
    4901           0 :                 ndr_print_policy_handle(ndr, "phPrinterIC", r->out.phPrinterIC);
    4902           0 :                 ndr->depth--;
    4903           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    4904           0 :                 ndr->depth--;
    4905             :         }
    4906           0 :         ndr->depth--;
    4907             : }
    4908             : 
    4909           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumPrinters(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrinters *r)
    4910             : {
    4911           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    4912           0 :         if (flags & NDR_IN) {
    4913           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Flags));
    4914           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    4915           0 :                 if (r->in.pName) {
    4916           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    4917           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    4918           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    4919           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    4920             :                 }
    4921           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    4922           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPrinterEnum));
    4923           0 :                 if (r->in.pPrinterEnum) {
    4924           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    4925           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pPrinterEnum, r->in.cbBuf));
    4926             :                 }
    4927           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    4928             :         }
    4929           0 :         if (flags & NDR_OUT) {
    4930           0 :                 if (r->out.pcbNeeded == NULL) {
    4931           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4932             :                 }
    4933           0 :                 if (r->out.pcReturned == NULL) {
    4934           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    4935             :                 }
    4936           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pPrinterEnum));
    4937           0 :                 if (r->out.pPrinterEnum) {
    4938           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    4939           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pPrinterEnum, r->in.cbBuf));
    4940             :                 }
    4941           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    4942           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    4943           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    4944             :         }
    4945           0 :         return NDR_ERR_SUCCESS;
    4946             : }
    4947             : 
    4948           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumPrinters(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrinters *r)
    4949             : {
    4950             :         uint32_t _ptr_pName;
    4951           0 :         uint32_t size_pName_1 = 0;
    4952           0 :         uint32_t length_pName_1 = 0;
    4953             :         uint32_t _ptr_pPrinterEnum;
    4954           0 :         uint32_t size_pPrinterEnum_1 = 0;
    4955           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    4956           0 :         TALLOC_CTX *_mem_save_pPrinterEnum_0 = NULL;
    4957           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    4958           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    4959           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    4960           0 :         if (flags & NDR_IN) {
    4961           0 :                 NDR_ZERO_STRUCT(r->out);
    4962             : 
    4963           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Flags));
    4964           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    4965           0 :                 if (_ptr_pName) {
    4966           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    4967             :                 } else {
    4968           0 :                         r->in.pName = NULL;
    4969             :                 }
    4970           0 :                 if (r->in.pName) {
    4971           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4972           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    4973           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    4974           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    4975           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    4976           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    4977           0 :                         if (length_pName_1 > size_pName_1) {
    4978           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    4979             :                         }
    4980           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    4981           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    4982           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    4983             :                 }
    4984           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    4985           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrinterEnum));
    4986           0 :                 if (_ptr_pPrinterEnum) {
    4987           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPrinterEnum);
    4988             :                 } else {
    4989           0 :                         r->in.pPrinterEnum = NULL;
    4990             :                 }
    4991           0 :                 if (r->in.pPrinterEnum) {
    4992           0 :                         _mem_save_pPrinterEnum_0 = NDR_PULL_GET_MEM_CTX(ndr);
    4993           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrinterEnum, 0);
    4994           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrinterEnum));
    4995           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pPrinterEnum, &size_pPrinterEnum_1));
    4996           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pPrinterEnum, size_pPrinterEnum_1);
    4997           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pPrinterEnum, size_pPrinterEnum_1));
    4998           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinterEnum_0, 0);
    4999             :                 }
    5000           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    5001           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    5002           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    5003           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    5004           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    5005           0 :                 if (r->in.pPrinterEnum) {
    5006           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pPrinterEnum, r->in.cbBuf));
    5007             :                 }
    5008             :         }
    5009           0 :         if (flags & NDR_OUT) {
    5010             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    5011             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    5012           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrinterEnum));
    5013           0 :                 if (_ptr_pPrinterEnum) {
    5014           0 :                         NDR_PULL_ALLOC(ndr, r->out.pPrinterEnum);
    5015             :                 } else {
    5016           0 :                         r->out.pPrinterEnum = NULL;
    5017             :                 }
    5018           0 :                 if (r->out.pPrinterEnum) {
    5019           0 :                         _mem_save_pPrinterEnum_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5020           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pPrinterEnum, 0);
    5021           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pPrinterEnum));
    5022           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pPrinterEnum, &size_pPrinterEnum_1));
    5023           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pPrinterEnum, size_pPrinterEnum_1);
    5024           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pPrinterEnum, size_pPrinterEnum_1));
    5025           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrinterEnum_0, 0);
    5026             :                 }
    5027           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    5028           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    5029             :                 }
    5030           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5031           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    5032           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    5033           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    5034           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    5035           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    5036             :                 }
    5037           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5038           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    5039           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    5040           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    5041           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    5042           0 :                 if (r->out.pPrinterEnum) {
    5043           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pPrinterEnum, r->in.cbBuf));
    5044             :                 }
    5045             :         }
    5046           0 :         return NDR_ERR_SUCCESS;
    5047             : }
    5048             : 
    5049           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrinters(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrinters *r)
    5050             : {
    5051           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrinters");
    5052           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    5053           0 :         ndr->depth++;
    5054           0 :         if (flags & NDR_SET_VALUES) {
    5055           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    5056             :         }
    5057           0 :         if (flags & NDR_IN) {
    5058           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrinters");
    5059           0 :                 ndr->depth++;
    5060           0 :                 ndr_print_uint32(ndr, "Flags", r->in.Flags);
    5061           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    5062           0 :                 ndr->depth++;
    5063           0 :                 if (r->in.pName) {
    5064           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    5065             :                 }
    5066           0 :                 ndr->depth--;
    5067           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    5068           0 :                 ndr_print_ptr(ndr, "pPrinterEnum", r->in.pPrinterEnum);
    5069           0 :                 ndr->depth++;
    5070           0 :                 if (r->in.pPrinterEnum) {
    5071           0 :                         ndr_print_array_uint8(ndr, "pPrinterEnum", r->in.pPrinterEnum, r->in.cbBuf);
    5072             :                 }
    5073           0 :                 ndr->depth--;
    5074           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    5075           0 :                 ndr->depth--;
    5076             :         }
    5077           0 :         if (flags & NDR_OUT) {
    5078           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrinters");
    5079           0 :                 ndr->depth++;
    5080           0 :                 ndr_print_ptr(ndr, "pPrinterEnum", r->out.pPrinterEnum);
    5081           0 :                 ndr->depth++;
    5082           0 :                 if (r->out.pPrinterEnum) {
    5083           0 :                         ndr_print_array_uint8(ndr, "pPrinterEnum", r->out.pPrinterEnum, r->in.cbBuf);
    5084             :                 }
    5085           0 :                 ndr->depth--;
    5086           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    5087           0 :                 ndr->depth++;
    5088           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    5089           0 :                 ndr->depth--;
    5090           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    5091           0 :                 ndr->depth++;
    5092           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    5093           0 :                 ndr->depth--;
    5094           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    5095           0 :                 ndr->depth--;
    5096             :         }
    5097           0 :         ndr->depth--;
    5098             : }
    5099             : 
    5100           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncAddPrinterDriver(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddPrinterDriver *r)
    5101             : {
    5102           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    5103           0 :         if (flags & NDR_IN) {
    5104           0 :                 if (r->in.pDriverContainer == NULL) {
    5105           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5106             :                 }
    5107           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    5108           0 :                 if (r->in.pName) {
    5109           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5110           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5111           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5112           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5113             :                 }
    5114           0 :                 NDR_CHECK(ndr_push_spoolss_AddDriverInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDriverContainer));
    5115           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dwFileCopyFlags));
    5116             :         }
    5117           0 :         if (flags & NDR_OUT) {
    5118           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    5119             :         }
    5120           0 :         return NDR_ERR_SUCCESS;
    5121             : }
    5122             : 
    5123           2 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncAddPrinterDriver(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddPrinterDriver *r)
    5124             : {
    5125             :         uint32_t _ptr_pName;
    5126           2 :         uint32_t size_pName_1 = 0;
    5127           2 :         uint32_t length_pName_1 = 0;
    5128           2 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    5129           2 :         TALLOC_CTX *_mem_save_pDriverContainer_0 = NULL;
    5130           2 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    5131           2 :         if (flags & NDR_IN) {
    5132           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    5133           2 :                 if (_ptr_pName) {
    5134           2 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    5135             :                 } else {
    5136           0 :                         r->in.pName = NULL;
    5137             :                 }
    5138           2 :                 if (r->in.pName) {
    5139           2 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5140           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    5141           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    5142           2 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    5143           2 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    5144           2 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    5145           2 :                         if (length_pName_1 > size_pName_1) {
    5146           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    5147             :                         }
    5148           2 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    5149           2 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    5150           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    5151             :                 }
    5152           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    5153           2 :                         NDR_PULL_ALLOC(ndr, r->in.pDriverContainer);
    5154             :                 }
    5155           2 :                 _mem_save_pDriverContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5156           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pDriverContainer, LIBNDR_FLAG_REF_ALLOC);
    5157           2 :                 NDR_CHECK(ndr_pull_spoolss_AddDriverInfoCtr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pDriverContainer));
    5158           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDriverContainer_0, LIBNDR_FLAG_REF_ALLOC);
    5159           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dwFileCopyFlags));
    5160             :         }
    5161           2 :         if (flags & NDR_OUT) {
    5162             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    5163             :                 if (r->in.pDriverContainer == NULL) {
    5164             :                         NDR_PULL_ALLOC(ndr, r->in.pDriverContainer);
    5165             :                         NDR_ZERO_STRUCTP(r->in.pDriverContainer);
    5166             :                 }
    5167             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    5168           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    5169             :         }
    5170           0 :         return NDR_ERR_SUCCESS;
    5171             : }
    5172             : 
    5173           2 : _PUBLIC_ void ndr_print_winspool_AsyncAddPrinterDriver(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddPrinterDriver *r)
    5174             : {
    5175           2 :         ndr_print_struct(ndr, name, "winspool_AsyncAddPrinterDriver");
    5176           2 :         if (r == NULL) { ndr_print_null(ndr); return; }
    5177           2 :         ndr->depth++;
    5178           2 :         if (flags & NDR_SET_VALUES) {
    5179           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    5180             :         }
    5181           2 :         if (flags & NDR_IN) {
    5182           2 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddPrinterDriver");
    5183           2 :                 ndr->depth++;
    5184           2 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    5185           2 :                 ndr->depth++;
    5186           2 :                 if (r->in.pName) {
    5187           2 :                         ndr_print_string(ndr, "pName", r->in.pName);
    5188             :                 }
    5189           2 :                 ndr->depth--;
    5190           2 :                 ndr_print_ptr(ndr, "pDriverContainer", r->in.pDriverContainer);
    5191           2 :                 ndr->depth++;
    5192           2 :                 ndr_print_spoolss_AddDriverInfoCtr(ndr, "pDriverContainer", r->in.pDriverContainer);
    5193           2 :                 ndr->depth--;
    5194           2 :                 ndr_print_uint32(ndr, "dwFileCopyFlags", r->in.dwFileCopyFlags);
    5195           2 :                 ndr->depth--;
    5196             :         }
    5197           2 :         if (flags & NDR_OUT) {
    5198           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddPrinterDriver");
    5199           0 :                 ndr->depth++;
    5200           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    5201           0 :                 ndr->depth--;
    5202             :         }
    5203           2 :         ndr->depth--;
    5204             : }
    5205             : 
    5206           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumPrinterDrivers(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrinterDrivers *r)
    5207             : {
    5208           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    5209           0 :         if (flags & NDR_IN) {
    5210           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    5211           0 :                 if (r->in.pName) {
    5212           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5213           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5214           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5215           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5216             :                 }
    5217           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    5218           0 :                 if (r->in.pEnvironment) {
    5219           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5220           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5221           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5222           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5223             :                 }
    5224           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    5225           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pDrivers));
    5226           0 :                 if (r->in.pDrivers) {
    5227           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    5228           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pDrivers, r->in.cbBuf));
    5229             :                 }
    5230           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    5231             :         }
    5232           0 :         if (flags & NDR_OUT) {
    5233           0 :                 if (r->out.pcbNeeded == NULL) {
    5234           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5235             :                 }
    5236           0 :                 if (r->out.pcReturned == NULL) {
    5237           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5238             :                 }
    5239           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pDrivers));
    5240           0 :                 if (r->out.pDrivers) {
    5241           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    5242           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pDrivers, r->in.cbBuf));
    5243             :                 }
    5244           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    5245           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    5246           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    5247             :         }
    5248           0 :         return NDR_ERR_SUCCESS;
    5249             : }
    5250             : 
    5251           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumPrinterDrivers(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrinterDrivers *r)
    5252             : {
    5253             :         uint32_t _ptr_pName;
    5254           0 :         uint32_t size_pName_1 = 0;
    5255           0 :         uint32_t length_pName_1 = 0;
    5256             :         uint32_t _ptr_pEnvironment;
    5257           0 :         uint32_t size_pEnvironment_1 = 0;
    5258           0 :         uint32_t length_pEnvironment_1 = 0;
    5259             :         uint32_t _ptr_pDrivers;
    5260           0 :         uint32_t size_pDrivers_1 = 0;
    5261           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    5262           0 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    5263           0 :         TALLOC_CTX *_mem_save_pDrivers_0 = NULL;
    5264           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    5265           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    5266           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    5267           0 :         if (flags & NDR_IN) {
    5268           0 :                 NDR_ZERO_STRUCT(r->out);
    5269             : 
    5270           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    5271           0 :                 if (_ptr_pName) {
    5272           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    5273             :                 } else {
    5274           0 :                         r->in.pName = NULL;
    5275             :                 }
    5276           0 :                 if (r->in.pName) {
    5277           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5278           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    5279           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    5280           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    5281           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    5282           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    5283           0 :                         if (length_pName_1 > size_pName_1) {
    5284           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    5285             :                         }
    5286           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    5287           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    5288           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    5289             :                 }
    5290           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    5291           0 :                 if (_ptr_pEnvironment) {
    5292           0 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    5293             :                 } else {
    5294           0 :                         r->in.pEnvironment = NULL;
    5295             :                 }
    5296           0 :                 if (r->in.pEnvironment) {
    5297           0 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5298           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    5299           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    5300           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    5301           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    5302           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    5303           0 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    5304           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    5305             :                         }
    5306           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    5307           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    5308           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    5309             :                 }
    5310           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    5311           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDrivers));
    5312           0 :                 if (_ptr_pDrivers) {
    5313           0 :                         NDR_PULL_ALLOC(ndr, r->in.pDrivers);
    5314             :                 } else {
    5315           0 :                         r->in.pDrivers = NULL;
    5316             :                 }
    5317           0 :                 if (r->in.pDrivers) {
    5318           0 :                         _mem_save_pDrivers_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5319           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pDrivers, 0);
    5320           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDrivers));
    5321           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pDrivers, &size_pDrivers_1));
    5322           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pDrivers, size_pDrivers_1);
    5323           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pDrivers, size_pDrivers_1));
    5324           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDrivers_0, 0);
    5325             :                 }
    5326           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    5327           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    5328           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    5329           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    5330           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    5331           0 :                 if (r->in.pDrivers) {
    5332           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pDrivers, r->in.cbBuf));
    5333             :                 }
    5334             :         }
    5335           0 :         if (flags & NDR_OUT) {
    5336             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    5337             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    5338           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDrivers));
    5339           0 :                 if (_ptr_pDrivers) {
    5340           0 :                         NDR_PULL_ALLOC(ndr, r->out.pDrivers);
    5341             :                 } else {
    5342           0 :                         r->out.pDrivers = NULL;
    5343             :                 }
    5344           0 :                 if (r->out.pDrivers) {
    5345           0 :                         _mem_save_pDrivers_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5346           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pDrivers, 0);
    5347           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pDrivers));
    5348           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pDrivers, &size_pDrivers_1));
    5349           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pDrivers, size_pDrivers_1);
    5350           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pDrivers, size_pDrivers_1));
    5351           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDrivers_0, 0);
    5352             :                 }
    5353           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    5354           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    5355             :                 }
    5356           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5357           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    5358           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    5359           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    5360           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    5361           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    5362             :                 }
    5363           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5364           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    5365           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    5366           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    5367           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    5368           0 :                 if (r->out.pDrivers) {
    5369           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pDrivers, r->in.cbBuf));
    5370             :                 }
    5371             :         }
    5372           0 :         return NDR_ERR_SUCCESS;
    5373             : }
    5374             : 
    5375           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrinterDrivers(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrinterDrivers *r)
    5376             : {
    5377           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrinterDrivers");
    5378           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    5379           0 :         ndr->depth++;
    5380           0 :         if (flags & NDR_SET_VALUES) {
    5381           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    5382             :         }
    5383           0 :         if (flags & NDR_IN) {
    5384           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrinterDrivers");
    5385           0 :                 ndr->depth++;
    5386           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    5387           0 :                 ndr->depth++;
    5388           0 :                 if (r->in.pName) {
    5389           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    5390             :                 }
    5391           0 :                 ndr->depth--;
    5392           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    5393           0 :                 ndr->depth++;
    5394           0 :                 if (r->in.pEnvironment) {
    5395           0 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    5396             :                 }
    5397           0 :                 ndr->depth--;
    5398           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    5399           0 :                 ndr_print_ptr(ndr, "pDrivers", r->in.pDrivers);
    5400           0 :                 ndr->depth++;
    5401           0 :                 if (r->in.pDrivers) {
    5402           0 :                         ndr_print_array_uint8(ndr, "pDrivers", r->in.pDrivers, r->in.cbBuf);
    5403             :                 }
    5404           0 :                 ndr->depth--;
    5405           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    5406           0 :                 ndr->depth--;
    5407             :         }
    5408           0 :         if (flags & NDR_OUT) {
    5409           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrinterDrivers");
    5410           0 :                 ndr->depth++;
    5411           0 :                 ndr_print_ptr(ndr, "pDrivers", r->out.pDrivers);
    5412           0 :                 ndr->depth++;
    5413           0 :                 if (r->out.pDrivers) {
    5414           0 :                         ndr_print_array_uint8(ndr, "pDrivers", r->out.pDrivers, r->in.cbBuf);
    5415             :                 }
    5416           0 :                 ndr->depth--;
    5417           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    5418           0 :                 ndr->depth++;
    5419           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    5420           0 :                 ndr->depth--;
    5421           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    5422           0 :                 ndr->depth++;
    5423           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    5424           0 :                 ndr->depth--;
    5425           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    5426           0 :                 ndr->depth--;
    5427             :         }
    5428           0 :         ndr->depth--;
    5429             : }
    5430             : 
    5431           0 : _PUBLIC_ enum ndr_err_code ndr_push_winspool_AsyncGetPrinterDriverDirectory(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetPrinterDriverDirectory *r)
    5432             : {
    5433           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    5434           0 :         if (flags & NDR_IN) {
    5435           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    5436           0 :                 if (r->in.pName) {
    5437           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5438           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5439           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5440           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5441             :                 }
    5442           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    5443           0 :                 if (r->in.pEnvironment) {
    5444           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5445           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5446           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5447           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5448             :                 }
    5449           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    5450           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pDriverDirectory));
    5451           0 :                 if (r->in.pDriverDirectory) {
    5452           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    5453           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pDriverDirectory, r->in.cbBuf));
    5454             :                 }
    5455           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    5456             :         }
    5457           0 :         if (flags & NDR_OUT) {
    5458           0 :                 if (r->out.pcbNeeded == NULL) {
    5459           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5460             :                 }
    5461           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pDriverDirectory));
    5462           0 :                 if (r->out.pDriverDirectory) {
    5463           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    5464           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pDriverDirectory, r->in.cbBuf));
    5465             :                 }
    5466           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    5467           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    5468             :         }
    5469           0 :         return NDR_ERR_SUCCESS;
    5470             : }
    5471             : 
    5472           6 : _PUBLIC_ enum ndr_err_code ndr_pull_winspool_AsyncGetPrinterDriverDirectory(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetPrinterDriverDirectory *r)
    5473             : {
    5474             :         uint32_t _ptr_pName;
    5475           6 :         uint32_t size_pName_1 = 0;
    5476           6 :         uint32_t length_pName_1 = 0;
    5477             :         uint32_t _ptr_pEnvironment;
    5478           6 :         uint32_t size_pEnvironment_1 = 0;
    5479           6 :         uint32_t length_pEnvironment_1 = 0;
    5480             :         uint32_t _ptr_pDriverDirectory;
    5481           6 :         uint32_t size_pDriverDirectory_1 = 0;
    5482           6 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    5483           6 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    5484           6 :         TALLOC_CTX *_mem_save_pDriverDirectory_0 = NULL;
    5485           6 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    5486           6 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    5487           6 :         if (flags & NDR_IN) {
    5488           4 :                 NDR_ZERO_STRUCT(r->out);
    5489             : 
    5490           4 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    5491           4 :                 if (_ptr_pName) {
    5492           4 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    5493             :                 } else {
    5494           0 :                         r->in.pName = NULL;
    5495             :                 }
    5496           4 :                 if (r->in.pName) {
    5497           4 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5498           4 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    5499           4 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    5500           4 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    5501           4 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    5502           4 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    5503           4 :                         if (length_pName_1 > size_pName_1) {
    5504           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    5505             :                         }
    5506           4 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    5507           4 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    5508           4 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    5509             :                 }
    5510           4 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    5511           4 :                 if (_ptr_pEnvironment) {
    5512           4 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    5513             :                 } else {
    5514           0 :                         r->in.pEnvironment = NULL;
    5515             :                 }
    5516           4 :                 if (r->in.pEnvironment) {
    5517           4 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5518           4 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    5519           4 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    5520           4 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    5521           4 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    5522           4 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    5523           4 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    5524           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    5525             :                         }
    5526           4 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    5527           4 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    5528           4 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    5529             :                 }
    5530           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    5531           4 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDriverDirectory));
    5532           4 :                 if (_ptr_pDriverDirectory) {
    5533           4 :                         NDR_PULL_ALLOC(ndr, r->in.pDriverDirectory);
    5534             :                 } else {
    5535           0 :                         r->in.pDriverDirectory = NULL;
    5536             :                 }
    5537           4 :                 if (r->in.pDriverDirectory) {
    5538           4 :                         _mem_save_pDriverDirectory_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5539           4 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pDriverDirectory, 0);
    5540           4 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDriverDirectory));
    5541           4 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pDriverDirectory, &size_pDriverDirectory_1));
    5542           4 :                         NDR_PULL_ALLOC_N(ndr, r->in.pDriverDirectory, size_pDriverDirectory_1);
    5543           4 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pDriverDirectory, size_pDriverDirectory_1));
    5544           4 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDriverDirectory_0, 0);
    5545             :                 }
    5546           4 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    5547           4 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    5548           4 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    5549           4 :                 if (r->in.pDriverDirectory) {
    5550           4 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pDriverDirectory, r->in.cbBuf));
    5551             :                 }
    5552             :         }
    5553           6 :         if (flags & NDR_OUT) {
    5554             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    5555             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    5556           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDriverDirectory));
    5557           2 :                 if (_ptr_pDriverDirectory) {
    5558           2 :                         NDR_PULL_ALLOC(ndr, r->out.pDriverDirectory);
    5559             :                 } else {
    5560           0 :                         r->out.pDriverDirectory = NULL;
    5561             :                 }
    5562           2 :                 if (r->out.pDriverDirectory) {
    5563           2 :                         _mem_save_pDriverDirectory_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5564           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pDriverDirectory, 0);
    5565           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pDriverDirectory));
    5566           2 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pDriverDirectory, &size_pDriverDirectory_1));
    5567           2 :                         NDR_PULL_ALLOC_N(ndr, r->out.pDriverDirectory, size_pDriverDirectory_1);
    5568           2 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pDriverDirectory, size_pDriverDirectory_1));
    5569           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDriverDirectory_0, 0);
    5570             :                 }
    5571           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    5572           2 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    5573             :                 }
    5574           2 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5575           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    5576           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    5577           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    5578           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    5579           2 :                 if (r->out.pDriverDirectory) {
    5580           2 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pDriverDirectory, r->in.cbBuf));
    5581             :                 }
    5582             :         }
    5583           0 :         return NDR_ERR_SUCCESS;
    5584             : }
    5585             : 
    5586           6 : _PUBLIC_ void ndr_print_winspool_AsyncGetPrinterDriverDirectory(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetPrinterDriverDirectory *r)
    5587             : {
    5588           6 :         ndr_print_struct(ndr, name, "winspool_AsyncGetPrinterDriverDirectory");
    5589           6 :         if (r == NULL) { ndr_print_null(ndr); return; }
    5590           6 :         ndr->depth++;
    5591           6 :         if (flags & NDR_SET_VALUES) {
    5592           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    5593             :         }
    5594           6 :         if (flags & NDR_IN) {
    5595           4 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetPrinterDriverDirectory");
    5596           4 :                 ndr->depth++;
    5597           4 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    5598           4 :                 ndr->depth++;
    5599           4 :                 if (r->in.pName) {
    5600           4 :                         ndr_print_string(ndr, "pName", r->in.pName);
    5601             :                 }
    5602           4 :                 ndr->depth--;
    5603           4 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    5604           4 :                 ndr->depth++;
    5605           4 :                 if (r->in.pEnvironment) {
    5606           4 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    5607             :                 }
    5608           4 :                 ndr->depth--;
    5609           4 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    5610           4 :                 ndr_print_ptr(ndr, "pDriverDirectory", r->in.pDriverDirectory);
    5611           4 :                 ndr->depth++;
    5612           4 :                 if (r->in.pDriverDirectory) {
    5613           4 :                         ndr_print_array_uint8(ndr, "pDriverDirectory", r->in.pDriverDirectory, r->in.cbBuf);
    5614             :                 }
    5615           4 :                 ndr->depth--;
    5616           4 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    5617           4 :                 ndr->depth--;
    5618             :         }
    5619           6 :         if (flags & NDR_OUT) {
    5620           2 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetPrinterDriverDirectory");
    5621           2 :                 ndr->depth++;
    5622           2 :                 ndr_print_ptr(ndr, "pDriverDirectory", r->out.pDriverDirectory);
    5623           2 :                 ndr->depth++;
    5624           2 :                 if (r->out.pDriverDirectory) {
    5625           2 :                         ndr_print_array_uint8(ndr, "pDriverDirectory", r->out.pDriverDirectory, r->in.cbBuf);
    5626             :                 }
    5627           2 :                 ndr->depth--;
    5628           2 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    5629           2 :                 ndr->depth++;
    5630           2 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    5631           2 :                 ndr->depth--;
    5632           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    5633           2 :                 ndr->depth--;
    5634             :         }
    5635           6 :         ndr->depth--;
    5636             : }
    5637             : 
    5638           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinterDriver(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinterDriver *r)
    5639             : {
    5640           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    5641           0 :         if (flags & NDR_IN) {
    5642           0 :                 if (r->in.pEnvironment == NULL) {
    5643           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5644             :                 }
    5645           0 :                 if (r->in.pDriverName == NULL) {
    5646           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5647             :                 }
    5648           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    5649           0 :                 if (r->in.pName) {
    5650           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5651           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5652           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5653           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5654             :                 }
    5655           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5656           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5657           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5658           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5659           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pDriverName, CH_UTF16)));
    5660           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5661           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pDriverName, CH_UTF16)));
    5662           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pDriverName, ndr_charset_length(r->in.pDriverName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5663             :         }
    5664           0 :         if (flags & NDR_OUT) {
    5665           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    5666             :         }
    5667           0 :         return NDR_ERR_SUCCESS;
    5668             : }
    5669             : 
    5670           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinterDriver(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinterDriver *r)
    5671             : {
    5672             :         uint32_t _ptr_pName;
    5673           0 :         uint32_t size_pName_1 = 0;
    5674           0 :         uint32_t length_pName_1 = 0;
    5675           0 :         uint32_t size_pEnvironment_1 = 0;
    5676           0 :         uint32_t length_pEnvironment_1 = 0;
    5677           0 :         uint32_t size_pDriverName_1 = 0;
    5678           0 :         uint32_t length_pDriverName_1 = 0;
    5679           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    5680           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    5681           0 :         if (flags & NDR_IN) {
    5682           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    5683           0 :                 if (_ptr_pName) {
    5684           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    5685             :                 } else {
    5686           0 :                         r->in.pName = NULL;
    5687             :                 }
    5688           0 :                 if (r->in.pName) {
    5689           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5690           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    5691           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    5692           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    5693           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    5694           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    5695           0 :                         if (length_pName_1 > size_pName_1) {
    5696           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    5697             :                         }
    5698           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    5699           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    5700           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    5701             :                 }
    5702           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    5703           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    5704           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    5705           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    5706           0 :                 if (length_pEnvironment_1 > size_pEnvironment_1) {
    5707           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    5708             :                 }
    5709           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    5710           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    5711           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDriverName));
    5712           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pDriverName));
    5713           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pDriverName, &size_pDriverName_1));
    5714           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pDriverName, &length_pDriverName_1));
    5715           0 :                 if (length_pDriverName_1 > size_pDriverName_1) {
    5716           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pDriverName_1, length_pDriverName_1);
    5717             :                 }
    5718           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pDriverName_1, sizeof(uint16_t)));
    5719           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pDriverName, length_pDriverName_1, sizeof(uint16_t), CH_UTF16));
    5720             :         }
    5721           0 :         if (flags & NDR_OUT) {
    5722             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    5723             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    5724           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    5725             :         }
    5726           0 :         return NDR_ERR_SUCCESS;
    5727             : }
    5728             : 
    5729           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinterDriver(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinterDriver *r)
    5730             : {
    5731           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinterDriver");
    5732           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    5733           0 :         ndr->depth++;
    5734           0 :         if (flags & NDR_SET_VALUES) {
    5735           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    5736             :         }
    5737           0 :         if (flags & NDR_IN) {
    5738           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinterDriver");
    5739           0 :                 ndr->depth++;
    5740           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    5741           0 :                 ndr->depth++;
    5742           0 :                 if (r->in.pName) {
    5743           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    5744             :                 }
    5745           0 :                 ndr->depth--;
    5746           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    5747           0 :                 ndr->depth++;
    5748           0 :                 ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    5749           0 :                 ndr->depth--;
    5750           0 :                 ndr_print_ptr(ndr, "pDriverName", r->in.pDriverName);
    5751           0 :                 ndr->depth++;
    5752           0 :                 ndr_print_string(ndr, "pDriverName", r->in.pDriverName);
    5753           0 :                 ndr->depth--;
    5754           0 :                 ndr->depth--;
    5755             :         }
    5756           0 :         if (flags & NDR_OUT) {
    5757           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinterDriver");
    5758           0 :                 ndr->depth++;
    5759           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    5760           0 :                 ndr->depth--;
    5761             :         }
    5762           0 :         ndr->depth--;
    5763             : }
    5764             : 
    5765           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrinterDriverEx(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrinterDriverEx *r)
    5766             : {
    5767           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    5768           0 :         if (flags & NDR_IN) {
    5769           0 :                 if (r->in.pEnvironment == NULL) {
    5770           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5771             :                 }
    5772           0 :                 if (r->in.pDriverName == NULL) {
    5773           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5774             :                 }
    5775           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    5776           0 :                 if (r->in.pName) {
    5777           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5778           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5779           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5780           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5781             :                 }
    5782           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5783           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5784           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5785           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5786           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pDriverName, CH_UTF16)));
    5787           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5788           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pDriverName, CH_UTF16)));
    5789           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pDriverName, ndr_charset_length(r->in.pDriverName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5790           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dwDeleteFlag));
    5791           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.dwVersionNum));
    5792             :         }
    5793           0 :         if (flags & NDR_OUT) {
    5794           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    5795             :         }
    5796           0 :         return NDR_ERR_SUCCESS;
    5797             : }
    5798             : 
    5799           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrinterDriverEx(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrinterDriverEx *r)
    5800             : {
    5801             :         uint32_t _ptr_pName;
    5802           0 :         uint32_t size_pName_1 = 0;
    5803           0 :         uint32_t length_pName_1 = 0;
    5804           0 :         uint32_t size_pEnvironment_1 = 0;
    5805           0 :         uint32_t length_pEnvironment_1 = 0;
    5806           0 :         uint32_t size_pDriverName_1 = 0;
    5807           0 :         uint32_t length_pDriverName_1 = 0;
    5808           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    5809           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    5810           0 :         if (flags & NDR_IN) {
    5811           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    5812           0 :                 if (_ptr_pName) {
    5813           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    5814             :                 } else {
    5815           0 :                         r->in.pName = NULL;
    5816             :                 }
    5817           0 :                 if (r->in.pName) {
    5818           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5819           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    5820           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    5821           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    5822           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    5823           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    5824           0 :                         if (length_pName_1 > size_pName_1) {
    5825           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    5826             :                         }
    5827           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    5828           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    5829           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    5830             :                 }
    5831           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    5832           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    5833           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    5834           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    5835           0 :                 if (length_pEnvironment_1 > size_pEnvironment_1) {
    5836           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    5837             :                 }
    5838           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    5839           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    5840           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDriverName));
    5841           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pDriverName));
    5842           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pDriverName, &size_pDriverName_1));
    5843           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pDriverName, &length_pDriverName_1));
    5844           0 :                 if (length_pDriverName_1 > size_pDriverName_1) {
    5845           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pDriverName_1, length_pDriverName_1);
    5846             :                 }
    5847           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pDriverName_1, sizeof(uint16_t)));
    5848           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pDriverName, length_pDriverName_1, sizeof(uint16_t), CH_UTF16));
    5849           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dwDeleteFlag));
    5850           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.dwVersionNum));
    5851             :         }
    5852           0 :         if (flags & NDR_OUT) {
    5853             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    5854             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    5855           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    5856             :         }
    5857           0 :         return NDR_ERR_SUCCESS;
    5858             : }
    5859             : 
    5860           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrinterDriverEx(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrinterDriverEx *r)
    5861             : {
    5862           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrinterDriverEx");
    5863           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    5864           0 :         ndr->depth++;
    5865           0 :         if (flags & NDR_SET_VALUES) {
    5866           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    5867             :         }
    5868           0 :         if (flags & NDR_IN) {
    5869           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrinterDriverEx");
    5870           0 :                 ndr->depth++;
    5871           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    5872           0 :                 ndr->depth++;
    5873           0 :                 if (r->in.pName) {
    5874           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    5875             :                 }
    5876           0 :                 ndr->depth--;
    5877           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    5878           0 :                 ndr->depth++;
    5879           0 :                 ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    5880           0 :                 ndr->depth--;
    5881           0 :                 ndr_print_ptr(ndr, "pDriverName", r->in.pDriverName);
    5882           0 :                 ndr->depth++;
    5883           0 :                 ndr_print_string(ndr, "pDriverName", r->in.pDriverName);
    5884           0 :                 ndr->depth--;
    5885           0 :                 ndr_print_uint32(ndr, "dwDeleteFlag", r->in.dwDeleteFlag);
    5886           0 :                 ndr_print_uint32(ndr, "dwVersionNum", r->in.dwVersionNum);
    5887           0 :                 ndr->depth--;
    5888             :         }
    5889           0 :         if (flags & NDR_OUT) {
    5890           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrinterDriverEx");
    5891           0 :                 ndr->depth++;
    5892           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    5893           0 :                 ndr->depth--;
    5894             :         }
    5895           0 :         ndr->depth--;
    5896             : }
    5897             : 
    5898           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddPrintProcessor(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddPrintProcessor *r)
    5899             : {
    5900           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    5901           0 :         if (flags & NDR_IN) {
    5902           0 :                 if (r->in.pEnvironment == NULL) {
    5903           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5904             :                 }
    5905           0 :                 if (r->in.pPathName == NULL) {
    5906           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5907             :                 }
    5908           0 :                 if (r->in.pPrintProcessorName == NULL) {
    5909           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    5910             :                 }
    5911           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    5912           0 :                 if (r->in.pName) {
    5913           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5914           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5915           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    5916           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5917             :                 }
    5918           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5919           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5920           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    5921           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5922           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPathName, CH_UTF16)));
    5923           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5924           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPathName, CH_UTF16)));
    5925           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPathName, ndr_charset_length(r->in.pPathName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5926           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16)));
    5927           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    5928           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16)));
    5929           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPrintProcessorName, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    5930             :         }
    5931           0 :         if (flags & NDR_OUT) {
    5932           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    5933             :         }
    5934           0 :         return NDR_ERR_SUCCESS;
    5935             : }
    5936             : 
    5937           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddPrintProcessor(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddPrintProcessor *r)
    5938             : {
    5939             :         uint32_t _ptr_pName;
    5940           0 :         uint32_t size_pName_1 = 0;
    5941           0 :         uint32_t length_pName_1 = 0;
    5942           0 :         uint32_t size_pEnvironment_1 = 0;
    5943           0 :         uint32_t length_pEnvironment_1 = 0;
    5944           0 :         uint32_t size_pPathName_1 = 0;
    5945           0 :         uint32_t length_pPathName_1 = 0;
    5946           0 :         uint32_t size_pPrintProcessorName_1 = 0;
    5947           0 :         uint32_t length_pPrintProcessorName_1 = 0;
    5948           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    5949           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    5950           0 :         if (flags & NDR_IN) {
    5951           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    5952           0 :                 if (_ptr_pName) {
    5953           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    5954             :                 } else {
    5955           0 :                         r->in.pName = NULL;
    5956             :                 }
    5957           0 :                 if (r->in.pName) {
    5958           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    5959           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    5960           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    5961           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    5962           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    5963           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    5964           0 :                         if (length_pName_1 > size_pName_1) {
    5965           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    5966             :                         }
    5967           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    5968           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    5969           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    5970             :                 }
    5971           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    5972           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    5973           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    5974           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    5975           0 :                 if (length_pEnvironment_1 > size_pEnvironment_1) {
    5976           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    5977             :                 }
    5978           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    5979           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    5980           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPathName));
    5981           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPathName));
    5982           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPathName, &size_pPathName_1));
    5983           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPathName, &length_pPathName_1));
    5984           0 :                 if (length_pPathName_1 > size_pPathName_1) {
    5985           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPathName_1, length_pPathName_1);
    5986             :                 }
    5987           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pPathName_1, sizeof(uint16_t)));
    5988           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPathName, length_pPathName_1, sizeof(uint16_t), CH_UTF16));
    5989           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrintProcessorName));
    5990           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPrintProcessorName));
    5991           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPrintProcessorName, &size_pPrintProcessorName_1));
    5992           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPrintProcessorName, &length_pPrintProcessorName_1));
    5993           0 :                 if (length_pPrintProcessorName_1 > size_pPrintProcessorName_1) {
    5994           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPrintProcessorName_1, length_pPrintProcessorName_1);
    5995             :                 }
    5996           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pPrintProcessorName_1, sizeof(uint16_t)));
    5997           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPrintProcessorName, length_pPrintProcessorName_1, sizeof(uint16_t), CH_UTF16));
    5998             :         }
    5999           0 :         if (flags & NDR_OUT) {
    6000             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    6001             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    6002           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    6003             :         }
    6004           0 :         return NDR_ERR_SUCCESS;
    6005             : }
    6006             : 
    6007           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddPrintProcessor(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddPrintProcessor *r)
    6008             : {
    6009           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddPrintProcessor");
    6010           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    6011           0 :         ndr->depth++;
    6012           0 :         if (flags & NDR_SET_VALUES) {
    6013           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    6014             :         }
    6015           0 :         if (flags & NDR_IN) {
    6016           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddPrintProcessor");
    6017           0 :                 ndr->depth++;
    6018           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    6019           0 :                 ndr->depth++;
    6020           0 :                 if (r->in.pName) {
    6021           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    6022             :                 }
    6023           0 :                 ndr->depth--;
    6024           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    6025           0 :                 ndr->depth++;
    6026           0 :                 ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    6027           0 :                 ndr->depth--;
    6028           0 :                 ndr_print_ptr(ndr, "pPathName", r->in.pPathName);
    6029           0 :                 ndr->depth++;
    6030           0 :                 ndr_print_string(ndr, "pPathName", r->in.pPathName);
    6031           0 :                 ndr->depth--;
    6032           0 :                 ndr_print_ptr(ndr, "pPrintProcessorName", r->in.pPrintProcessorName);
    6033           0 :                 ndr->depth++;
    6034           0 :                 ndr_print_string(ndr, "pPrintProcessorName", r->in.pPrintProcessorName);
    6035           0 :                 ndr->depth--;
    6036           0 :                 ndr->depth--;
    6037             :         }
    6038           0 :         if (flags & NDR_OUT) {
    6039           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddPrintProcessor");
    6040           0 :                 ndr->depth++;
    6041           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    6042           0 :                 ndr->depth--;
    6043             :         }
    6044           0 :         ndr->depth--;
    6045             : }
    6046             : 
    6047           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumPrintProcessors(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrintProcessors *r)
    6048             : {
    6049           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    6050           0 :         if (flags & NDR_IN) {
    6051           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    6052           0 :                 if (r->in.pName) {
    6053           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6054           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6055           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6056           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6057             :                 }
    6058           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    6059           0 :                 if (r->in.pEnvironment) {
    6060           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    6061           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6062           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    6063           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6064             :                 }
    6065           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    6066           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPrintProcessorInfo));
    6067           0 :                 if (r->in.pPrintProcessorInfo) {
    6068           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6069           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pPrintProcessorInfo, r->in.cbBuf));
    6070             :                 }
    6071           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    6072             :         }
    6073           0 :         if (flags & NDR_OUT) {
    6074           0 :                 if (r->out.pcbNeeded == NULL) {
    6075           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6076             :                 }
    6077           0 :                 if (r->out.pcReturned == NULL) {
    6078           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6079             :                 }
    6080           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pPrintProcessorInfo));
    6081           0 :                 if (r->out.pPrintProcessorInfo) {
    6082           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6083           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pPrintProcessorInfo, r->in.cbBuf));
    6084             :                 }
    6085           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    6086           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    6087           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    6088             :         }
    6089           0 :         return NDR_ERR_SUCCESS;
    6090             : }
    6091             : 
    6092           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumPrintProcessors(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrintProcessors *r)
    6093             : {
    6094             :         uint32_t _ptr_pName;
    6095           0 :         uint32_t size_pName_1 = 0;
    6096           0 :         uint32_t length_pName_1 = 0;
    6097             :         uint32_t _ptr_pEnvironment;
    6098           0 :         uint32_t size_pEnvironment_1 = 0;
    6099           0 :         uint32_t length_pEnvironment_1 = 0;
    6100             :         uint32_t _ptr_pPrintProcessorInfo;
    6101           0 :         uint32_t size_pPrintProcessorInfo_1 = 0;
    6102           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    6103           0 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    6104           0 :         TALLOC_CTX *_mem_save_pPrintProcessorInfo_0 = NULL;
    6105           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    6106           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    6107           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    6108           0 :         if (flags & NDR_IN) {
    6109           0 :                 NDR_ZERO_STRUCT(r->out);
    6110             : 
    6111           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    6112           0 :                 if (_ptr_pName) {
    6113           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    6114             :                 } else {
    6115           0 :                         r->in.pName = NULL;
    6116             :                 }
    6117           0 :                 if (r->in.pName) {
    6118           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6119           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    6120           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    6121           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    6122           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    6123           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    6124           0 :                         if (length_pName_1 > size_pName_1) {
    6125           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    6126             :                         }
    6127           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    6128           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    6129           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    6130             :                 }
    6131           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    6132           0 :                 if (_ptr_pEnvironment) {
    6133           0 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    6134             :                 } else {
    6135           0 :                         r->in.pEnvironment = NULL;
    6136             :                 }
    6137           0 :                 if (r->in.pEnvironment) {
    6138           0 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6139           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    6140           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    6141           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    6142           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    6143           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    6144           0 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    6145           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    6146             :                         }
    6147           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    6148           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    6149           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    6150             :                 }
    6151           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    6152           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrintProcessorInfo));
    6153           0 :                 if (_ptr_pPrintProcessorInfo) {
    6154           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPrintProcessorInfo);
    6155             :                 } else {
    6156           0 :                         r->in.pPrintProcessorInfo = NULL;
    6157             :                 }
    6158           0 :                 if (r->in.pPrintProcessorInfo) {
    6159           0 :                         _mem_save_pPrintProcessorInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6160           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrintProcessorInfo, 0);
    6161           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrintProcessorInfo));
    6162           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pPrintProcessorInfo, &size_pPrintProcessorInfo_1));
    6163           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pPrintProcessorInfo, size_pPrintProcessorInfo_1);
    6164           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pPrintProcessorInfo, size_pPrintProcessorInfo_1));
    6165           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrintProcessorInfo_0, 0);
    6166             :                 }
    6167           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    6168           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6169           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    6170           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    6171           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    6172           0 :                 if (r->in.pPrintProcessorInfo) {
    6173           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pPrintProcessorInfo, r->in.cbBuf));
    6174             :                 }
    6175             :         }
    6176           0 :         if (flags & NDR_OUT) {
    6177             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    6178             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    6179           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrintProcessorInfo));
    6180           0 :                 if (_ptr_pPrintProcessorInfo) {
    6181           0 :                         NDR_PULL_ALLOC(ndr, r->out.pPrintProcessorInfo);
    6182             :                 } else {
    6183           0 :                         r->out.pPrintProcessorInfo = NULL;
    6184             :                 }
    6185           0 :                 if (r->out.pPrintProcessorInfo) {
    6186           0 :                         _mem_save_pPrintProcessorInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6187           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pPrintProcessorInfo, 0);
    6188           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pPrintProcessorInfo));
    6189           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pPrintProcessorInfo, &size_pPrintProcessorInfo_1));
    6190           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pPrintProcessorInfo, size_pPrintProcessorInfo_1);
    6191           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pPrintProcessorInfo, size_pPrintProcessorInfo_1));
    6192           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrintProcessorInfo_0, 0);
    6193             :                 }
    6194           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6195           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6196             :                 }
    6197           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6198           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    6199           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    6200           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    6201           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6202           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    6203             :                 }
    6204           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6205           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    6206           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    6207           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    6208           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    6209           0 :                 if (r->out.pPrintProcessorInfo) {
    6210           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pPrintProcessorInfo, r->in.cbBuf));
    6211             :                 }
    6212             :         }
    6213           0 :         return NDR_ERR_SUCCESS;
    6214             : }
    6215             : 
    6216           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrintProcessors(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrintProcessors *r)
    6217             : {
    6218           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrintProcessors");
    6219           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    6220           0 :         ndr->depth++;
    6221           0 :         if (flags & NDR_SET_VALUES) {
    6222           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    6223             :         }
    6224           0 :         if (flags & NDR_IN) {
    6225           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrintProcessors");
    6226           0 :                 ndr->depth++;
    6227           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    6228           0 :                 ndr->depth++;
    6229           0 :                 if (r->in.pName) {
    6230           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    6231             :                 }
    6232           0 :                 ndr->depth--;
    6233           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    6234           0 :                 ndr->depth++;
    6235           0 :                 if (r->in.pEnvironment) {
    6236           0 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    6237             :                 }
    6238           0 :                 ndr->depth--;
    6239           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    6240           0 :                 ndr_print_ptr(ndr, "pPrintProcessorInfo", r->in.pPrintProcessorInfo);
    6241           0 :                 ndr->depth++;
    6242           0 :                 if (r->in.pPrintProcessorInfo) {
    6243           0 :                         ndr_print_array_uint8(ndr, "pPrintProcessorInfo", r->in.pPrintProcessorInfo, r->in.cbBuf);
    6244             :                 }
    6245           0 :                 ndr->depth--;
    6246           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    6247           0 :                 ndr->depth--;
    6248             :         }
    6249           0 :         if (flags & NDR_OUT) {
    6250           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrintProcessors");
    6251           0 :                 ndr->depth++;
    6252           0 :                 ndr_print_ptr(ndr, "pPrintProcessorInfo", r->out.pPrintProcessorInfo);
    6253           0 :                 ndr->depth++;
    6254           0 :                 if (r->out.pPrintProcessorInfo) {
    6255           0 :                         ndr_print_array_uint8(ndr, "pPrintProcessorInfo", r->out.pPrintProcessorInfo, r->in.cbBuf);
    6256             :                 }
    6257           0 :                 ndr->depth--;
    6258           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    6259           0 :                 ndr->depth++;
    6260           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    6261           0 :                 ndr->depth--;
    6262           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    6263           0 :                 ndr->depth++;
    6264           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    6265           0 :                 ndr->depth--;
    6266           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    6267           0 :                 ndr->depth--;
    6268             :         }
    6269           0 :         ndr->depth--;
    6270             : }
    6271             : 
    6272           0 : static enum ndr_err_code ndr_push_winspool_AsyncGetPrintProcessorDirectory(struct ndr_push *ndr, int flags, const struct winspool_AsyncGetPrintProcessorDirectory *r)
    6273             : {
    6274           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    6275           0 :         if (flags & NDR_IN) {
    6276           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    6277           0 :                 if (r->in.pName) {
    6278           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6279           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6280           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6281           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6282             :                 }
    6283           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    6284           0 :                 if (r->in.pEnvironment) {
    6285           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    6286           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6287           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    6288           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6289             :                 }
    6290           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    6291           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPrintProcessorDirectory));
    6292           0 :                 if (r->in.pPrintProcessorDirectory) {
    6293           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6294           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pPrintProcessorDirectory, r->in.cbBuf));
    6295             :                 }
    6296           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    6297             :         }
    6298           0 :         if (flags & NDR_OUT) {
    6299           0 :                 if (r->out.pcbNeeded == NULL) {
    6300           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6301             :                 }
    6302           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pPrintProcessorDirectory));
    6303           0 :                 if (r->out.pPrintProcessorDirectory) {
    6304           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6305           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pPrintProcessorDirectory, r->in.cbBuf));
    6306             :                 }
    6307           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    6308           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    6309             :         }
    6310           0 :         return NDR_ERR_SUCCESS;
    6311             : }
    6312             : 
    6313           0 : static enum ndr_err_code ndr_pull_winspool_AsyncGetPrintProcessorDirectory(struct ndr_pull *ndr, int flags, struct winspool_AsyncGetPrintProcessorDirectory *r)
    6314             : {
    6315             :         uint32_t _ptr_pName;
    6316           0 :         uint32_t size_pName_1 = 0;
    6317           0 :         uint32_t length_pName_1 = 0;
    6318             :         uint32_t _ptr_pEnvironment;
    6319           0 :         uint32_t size_pEnvironment_1 = 0;
    6320           0 :         uint32_t length_pEnvironment_1 = 0;
    6321             :         uint32_t _ptr_pPrintProcessorDirectory;
    6322           0 :         uint32_t size_pPrintProcessorDirectory_1 = 0;
    6323           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    6324           0 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    6325           0 :         TALLOC_CTX *_mem_save_pPrintProcessorDirectory_0 = NULL;
    6326           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    6327           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    6328           0 :         if (flags & NDR_IN) {
    6329           0 :                 NDR_ZERO_STRUCT(r->out);
    6330             : 
    6331           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    6332           0 :                 if (_ptr_pName) {
    6333           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    6334             :                 } else {
    6335           0 :                         r->in.pName = NULL;
    6336             :                 }
    6337           0 :                 if (r->in.pName) {
    6338           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6339           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    6340           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    6341           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    6342           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    6343           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    6344           0 :                         if (length_pName_1 > size_pName_1) {
    6345           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    6346             :                         }
    6347           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    6348           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    6349           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    6350             :                 }
    6351           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    6352           0 :                 if (_ptr_pEnvironment) {
    6353           0 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    6354             :                 } else {
    6355           0 :                         r->in.pEnvironment = NULL;
    6356             :                 }
    6357           0 :                 if (r->in.pEnvironment) {
    6358           0 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6359           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    6360           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    6361           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    6362           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    6363           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    6364           0 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    6365           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    6366             :                         }
    6367           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    6368           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    6369           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    6370             :                 }
    6371           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    6372           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrintProcessorDirectory));
    6373           0 :                 if (_ptr_pPrintProcessorDirectory) {
    6374           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPrintProcessorDirectory);
    6375             :                 } else {
    6376           0 :                         r->in.pPrintProcessorDirectory = NULL;
    6377             :                 }
    6378           0 :                 if (r->in.pPrintProcessorDirectory) {
    6379           0 :                         _mem_save_pPrintProcessorDirectory_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6380           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrintProcessorDirectory, 0);
    6381           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrintProcessorDirectory));
    6382           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pPrintProcessorDirectory, &size_pPrintProcessorDirectory_1));
    6383           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pPrintProcessorDirectory, size_pPrintProcessorDirectory_1);
    6384           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pPrintProcessorDirectory, size_pPrintProcessorDirectory_1));
    6385           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrintProcessorDirectory_0, 0);
    6386             :                 }
    6387           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    6388           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6389           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    6390           0 :                 if (r->in.pPrintProcessorDirectory) {
    6391           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pPrintProcessorDirectory, r->in.cbBuf));
    6392             :                 }
    6393             :         }
    6394           0 :         if (flags & NDR_OUT) {
    6395             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    6396             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    6397           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrintProcessorDirectory));
    6398           0 :                 if (_ptr_pPrintProcessorDirectory) {
    6399           0 :                         NDR_PULL_ALLOC(ndr, r->out.pPrintProcessorDirectory);
    6400             :                 } else {
    6401           0 :                         r->out.pPrintProcessorDirectory = NULL;
    6402             :                 }
    6403           0 :                 if (r->out.pPrintProcessorDirectory) {
    6404           0 :                         _mem_save_pPrintProcessorDirectory_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6405           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pPrintProcessorDirectory, 0);
    6406           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pPrintProcessorDirectory));
    6407           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pPrintProcessorDirectory, &size_pPrintProcessorDirectory_1));
    6408           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pPrintProcessorDirectory, size_pPrintProcessorDirectory_1);
    6409           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pPrintProcessorDirectory, size_pPrintProcessorDirectory_1));
    6410           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrintProcessorDirectory_0, 0);
    6411             :                 }
    6412           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6413           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6414             :                 }
    6415           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6416           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    6417           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    6418           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    6419           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    6420           0 :                 if (r->out.pPrintProcessorDirectory) {
    6421           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pPrintProcessorDirectory, r->in.cbBuf));
    6422             :                 }
    6423             :         }
    6424           0 :         return NDR_ERR_SUCCESS;
    6425             : }
    6426             : 
    6427           0 : _PUBLIC_ void ndr_print_winspool_AsyncGetPrintProcessorDirectory(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncGetPrintProcessorDirectory *r)
    6428             : {
    6429           0 :         ndr_print_struct(ndr, name, "winspool_AsyncGetPrintProcessorDirectory");
    6430           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    6431           0 :         ndr->depth++;
    6432           0 :         if (flags & NDR_SET_VALUES) {
    6433           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    6434             :         }
    6435           0 :         if (flags & NDR_IN) {
    6436           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncGetPrintProcessorDirectory");
    6437           0 :                 ndr->depth++;
    6438           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    6439           0 :                 ndr->depth++;
    6440           0 :                 if (r->in.pName) {
    6441           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    6442             :                 }
    6443           0 :                 ndr->depth--;
    6444           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    6445           0 :                 ndr->depth++;
    6446           0 :                 if (r->in.pEnvironment) {
    6447           0 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    6448             :                 }
    6449           0 :                 ndr->depth--;
    6450           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    6451           0 :                 ndr_print_ptr(ndr, "pPrintProcessorDirectory", r->in.pPrintProcessorDirectory);
    6452           0 :                 ndr->depth++;
    6453           0 :                 if (r->in.pPrintProcessorDirectory) {
    6454           0 :                         ndr_print_array_uint8(ndr, "pPrintProcessorDirectory", r->in.pPrintProcessorDirectory, r->in.cbBuf);
    6455             :                 }
    6456           0 :                 ndr->depth--;
    6457           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    6458           0 :                 ndr->depth--;
    6459             :         }
    6460           0 :         if (flags & NDR_OUT) {
    6461           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncGetPrintProcessorDirectory");
    6462           0 :                 ndr->depth++;
    6463           0 :                 ndr_print_ptr(ndr, "pPrintProcessorDirectory", r->out.pPrintProcessorDirectory);
    6464           0 :                 ndr->depth++;
    6465           0 :                 if (r->out.pPrintProcessorDirectory) {
    6466           0 :                         ndr_print_array_uint8(ndr, "pPrintProcessorDirectory", r->out.pPrintProcessorDirectory, r->in.cbBuf);
    6467             :                 }
    6468           0 :                 ndr->depth--;
    6469           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    6470           0 :                 ndr->depth++;
    6471           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    6472           0 :                 ndr->depth--;
    6473           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    6474           0 :                 ndr->depth--;
    6475             :         }
    6476           0 :         ndr->depth--;
    6477             : }
    6478             : 
    6479           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumPorts(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPorts *r)
    6480             : {
    6481           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    6482           0 :         if (flags & NDR_IN) {
    6483           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    6484           0 :                 if (r->in.pName) {
    6485           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6486           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6487           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6488           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6489             :                 }
    6490           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    6491           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPort));
    6492           0 :                 if (r->in.pPort) {
    6493           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6494           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pPort, r->in.cbBuf));
    6495             :                 }
    6496           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    6497             :         }
    6498           0 :         if (flags & NDR_OUT) {
    6499           0 :                 if (r->out.pcbNeeded == NULL) {
    6500           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6501             :                 }
    6502           0 :                 if (r->out.pcReturned == NULL) {
    6503           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6504             :                 }
    6505           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pPort));
    6506           0 :                 if (r->out.pPort) {
    6507           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6508           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pPort, r->in.cbBuf));
    6509             :                 }
    6510           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    6511           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    6512           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    6513             :         }
    6514           0 :         return NDR_ERR_SUCCESS;
    6515             : }
    6516             : 
    6517           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumPorts(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPorts *r)
    6518             : {
    6519             :         uint32_t _ptr_pName;
    6520           0 :         uint32_t size_pName_1 = 0;
    6521           0 :         uint32_t length_pName_1 = 0;
    6522             :         uint32_t _ptr_pPort;
    6523           0 :         uint32_t size_pPort_1 = 0;
    6524           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    6525           0 :         TALLOC_CTX *_mem_save_pPort_0 = NULL;
    6526           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    6527           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    6528           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    6529           0 :         if (flags & NDR_IN) {
    6530           0 :                 NDR_ZERO_STRUCT(r->out);
    6531             : 
    6532           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    6533           0 :                 if (_ptr_pName) {
    6534           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    6535             :                 } else {
    6536           0 :                         r->in.pName = NULL;
    6537             :                 }
    6538           0 :                 if (r->in.pName) {
    6539           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6540           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    6541           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    6542           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    6543           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    6544           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    6545           0 :                         if (length_pName_1 > size_pName_1) {
    6546           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    6547             :                         }
    6548           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    6549           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    6550           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    6551             :                 }
    6552           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    6553           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPort));
    6554           0 :                 if (_ptr_pPort) {
    6555           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPort);
    6556             :                 } else {
    6557           0 :                         r->in.pPort = NULL;
    6558             :                 }
    6559           0 :                 if (r->in.pPort) {
    6560           0 :                         _mem_save_pPort_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6561           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPort, 0);
    6562           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPort));
    6563           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pPort, &size_pPort_1));
    6564           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pPort, size_pPort_1);
    6565           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pPort, size_pPort_1));
    6566           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPort_0, 0);
    6567             :                 }
    6568           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    6569           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6570           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    6571           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    6572           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    6573           0 :                 if (r->in.pPort) {
    6574           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pPort, r->in.cbBuf));
    6575             :                 }
    6576             :         }
    6577           0 :         if (flags & NDR_OUT) {
    6578             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    6579             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    6580           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPort));
    6581           0 :                 if (_ptr_pPort) {
    6582           0 :                         NDR_PULL_ALLOC(ndr, r->out.pPort);
    6583             :                 } else {
    6584           0 :                         r->out.pPort = NULL;
    6585             :                 }
    6586           0 :                 if (r->out.pPort) {
    6587           0 :                         _mem_save_pPort_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6588           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pPort, 0);
    6589           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pPort));
    6590           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pPort, &size_pPort_1));
    6591           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pPort, size_pPort_1);
    6592           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pPort, size_pPort_1));
    6593           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPort_0, 0);
    6594             :                 }
    6595           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6596           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6597             :                 }
    6598           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6599           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    6600           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    6601           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    6602           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6603           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    6604             :                 }
    6605           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6606           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    6607           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    6608           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    6609           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    6610           0 :                 if (r->out.pPort) {
    6611           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pPort, r->in.cbBuf));
    6612             :                 }
    6613             :         }
    6614           0 :         return NDR_ERR_SUCCESS;
    6615             : }
    6616             : 
    6617           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPorts(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPorts *r)
    6618             : {
    6619           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPorts");
    6620           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    6621           0 :         ndr->depth++;
    6622           0 :         if (flags & NDR_SET_VALUES) {
    6623           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    6624             :         }
    6625           0 :         if (flags & NDR_IN) {
    6626           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPorts");
    6627           0 :                 ndr->depth++;
    6628           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    6629           0 :                 ndr->depth++;
    6630           0 :                 if (r->in.pName) {
    6631           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    6632             :                 }
    6633           0 :                 ndr->depth--;
    6634           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    6635           0 :                 ndr_print_ptr(ndr, "pPort", r->in.pPort);
    6636           0 :                 ndr->depth++;
    6637           0 :                 if (r->in.pPort) {
    6638           0 :                         ndr_print_array_uint8(ndr, "pPort", r->in.pPort, r->in.cbBuf);
    6639             :                 }
    6640           0 :                 ndr->depth--;
    6641           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    6642           0 :                 ndr->depth--;
    6643             :         }
    6644           0 :         if (flags & NDR_OUT) {
    6645           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPorts");
    6646           0 :                 ndr->depth++;
    6647           0 :                 ndr_print_ptr(ndr, "pPort", r->out.pPort);
    6648           0 :                 ndr->depth++;
    6649           0 :                 if (r->out.pPort) {
    6650           0 :                         ndr_print_array_uint8(ndr, "pPort", r->out.pPort, r->in.cbBuf);
    6651             :                 }
    6652           0 :                 ndr->depth--;
    6653           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    6654           0 :                 ndr->depth++;
    6655           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    6656           0 :                 ndr->depth--;
    6657           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    6658           0 :                 ndr->depth++;
    6659           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    6660           0 :                 ndr->depth--;
    6661           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    6662           0 :                 ndr->depth--;
    6663             :         }
    6664           0 :         ndr->depth--;
    6665             : }
    6666             : 
    6667           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumMonitors(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumMonitors *r)
    6668             : {
    6669           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    6670           0 :         if (flags & NDR_IN) {
    6671           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    6672           0 :                 if (r->in.pName) {
    6673           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6674           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6675           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6676           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6677             :                 }
    6678           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    6679           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pMonitor));
    6680           0 :                 if (r->in.pMonitor) {
    6681           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6682           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pMonitor, r->in.cbBuf));
    6683             :                 }
    6684           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    6685             :         }
    6686           0 :         if (flags & NDR_OUT) {
    6687           0 :                 if (r->out.pcbNeeded == NULL) {
    6688           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6689             :                 }
    6690           0 :                 if (r->out.pcReturned == NULL) {
    6691           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6692             :                 }
    6693           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pMonitor));
    6694           0 :                 if (r->out.pMonitor) {
    6695           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    6696           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pMonitor, r->in.cbBuf));
    6697             :                 }
    6698           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    6699           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    6700           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    6701             :         }
    6702           0 :         return NDR_ERR_SUCCESS;
    6703             : }
    6704             : 
    6705           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumMonitors(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumMonitors *r)
    6706             : {
    6707             :         uint32_t _ptr_pName;
    6708           0 :         uint32_t size_pName_1 = 0;
    6709           0 :         uint32_t length_pName_1 = 0;
    6710             :         uint32_t _ptr_pMonitor;
    6711           0 :         uint32_t size_pMonitor_1 = 0;
    6712           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    6713           0 :         TALLOC_CTX *_mem_save_pMonitor_0 = NULL;
    6714           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    6715           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    6716           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    6717           0 :         if (flags & NDR_IN) {
    6718           0 :                 NDR_ZERO_STRUCT(r->out);
    6719             : 
    6720           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    6721           0 :                 if (_ptr_pName) {
    6722           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    6723             :                 } else {
    6724           0 :                         r->in.pName = NULL;
    6725             :                 }
    6726           0 :                 if (r->in.pName) {
    6727           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6728           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    6729           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    6730           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    6731           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    6732           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    6733           0 :                         if (length_pName_1 > size_pName_1) {
    6734           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    6735             :                         }
    6736           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    6737           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    6738           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    6739             :                 }
    6740           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    6741           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pMonitor));
    6742           0 :                 if (_ptr_pMonitor) {
    6743           0 :                         NDR_PULL_ALLOC(ndr, r->in.pMonitor);
    6744             :                 } else {
    6745           0 :                         r->in.pMonitor = NULL;
    6746             :                 }
    6747           0 :                 if (r->in.pMonitor) {
    6748           0 :                         _mem_save_pMonitor_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6749           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pMonitor, 0);
    6750           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pMonitor));
    6751           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pMonitor, &size_pMonitor_1));
    6752           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pMonitor, size_pMonitor_1);
    6753           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pMonitor, size_pMonitor_1));
    6754           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pMonitor_0, 0);
    6755             :                 }
    6756           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    6757           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6758           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    6759           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    6760           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    6761           0 :                 if (r->in.pMonitor) {
    6762           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pMonitor, r->in.cbBuf));
    6763             :                 }
    6764             :         }
    6765           0 :         if (flags & NDR_OUT) {
    6766             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    6767             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    6768           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pMonitor));
    6769           0 :                 if (_ptr_pMonitor) {
    6770           0 :                         NDR_PULL_ALLOC(ndr, r->out.pMonitor);
    6771             :                 } else {
    6772           0 :                         r->out.pMonitor = NULL;
    6773             :                 }
    6774           0 :                 if (r->out.pMonitor) {
    6775           0 :                         _mem_save_pMonitor_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6776           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pMonitor, 0);
    6777           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pMonitor));
    6778           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pMonitor, &size_pMonitor_1));
    6779           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pMonitor, size_pMonitor_1);
    6780           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pMonitor, size_pMonitor_1));
    6781           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pMonitor_0, 0);
    6782             :                 }
    6783           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6784           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    6785             :                 }
    6786           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6787           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    6788           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    6789           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    6790           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6791           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    6792             :                 }
    6793           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6794           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    6795           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    6796           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    6797           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    6798           0 :                 if (r->out.pMonitor) {
    6799           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pMonitor, r->in.cbBuf));
    6800             :                 }
    6801             :         }
    6802           0 :         return NDR_ERR_SUCCESS;
    6803             : }
    6804             : 
    6805           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumMonitors(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumMonitors *r)
    6806             : {
    6807           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumMonitors");
    6808           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    6809           0 :         ndr->depth++;
    6810           0 :         if (flags & NDR_SET_VALUES) {
    6811           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    6812             :         }
    6813           0 :         if (flags & NDR_IN) {
    6814           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumMonitors");
    6815           0 :                 ndr->depth++;
    6816           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    6817           0 :                 ndr->depth++;
    6818           0 :                 if (r->in.pName) {
    6819           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    6820             :                 }
    6821           0 :                 ndr->depth--;
    6822           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    6823           0 :                 ndr_print_ptr(ndr, "pMonitor", r->in.pMonitor);
    6824           0 :                 ndr->depth++;
    6825           0 :                 if (r->in.pMonitor) {
    6826           0 :                         ndr_print_array_uint8(ndr, "pMonitor", r->in.pMonitor, r->in.cbBuf);
    6827             :                 }
    6828           0 :                 ndr->depth--;
    6829           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    6830           0 :                 ndr->depth--;
    6831             :         }
    6832           0 :         if (flags & NDR_OUT) {
    6833           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumMonitors");
    6834           0 :                 ndr->depth++;
    6835           0 :                 ndr_print_ptr(ndr, "pMonitor", r->out.pMonitor);
    6836           0 :                 ndr->depth++;
    6837           0 :                 if (r->out.pMonitor) {
    6838           0 :                         ndr_print_array_uint8(ndr, "pMonitor", r->out.pMonitor, r->in.cbBuf);
    6839             :                 }
    6840           0 :                 ndr->depth--;
    6841           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    6842           0 :                 ndr->depth++;
    6843           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    6844           0 :                 ndr->depth--;
    6845           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    6846           0 :                 ndr->depth++;
    6847           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    6848           0 :                 ndr->depth--;
    6849           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    6850           0 :                 ndr->depth--;
    6851             :         }
    6852           0 :         ndr->depth--;
    6853             : }
    6854             : 
    6855           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddPort(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddPort *r)
    6856             : {
    6857           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    6858           0 :         if (flags & NDR_IN) {
    6859           0 :                 if (r->in.pPortContainer == NULL) {
    6860           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6861             :                 }
    6862           0 :                 if (r->in.pPortVarContainer == NULL) {
    6863           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6864             :                 }
    6865           0 :                 if (r->in.pMonitorName == NULL) {
    6866           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    6867             :                 }
    6868           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    6869           0 :                 if (r->in.pName) {
    6870           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6871           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6872           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    6873           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6874             :                 }
    6875           0 :                 NDR_CHECK(ndr_push_spoolss_SetPortInfoContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPortContainer));
    6876           0 :                 NDR_CHECK(ndr_push_spoolss_PortVarContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPortVarContainer));
    6877           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pMonitorName, CH_UTF16)));
    6878           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    6879           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pMonitorName, CH_UTF16)));
    6880           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pMonitorName, ndr_charset_length(r->in.pMonitorName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    6881             :         }
    6882           0 :         if (flags & NDR_OUT) {
    6883           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    6884             :         }
    6885           0 :         return NDR_ERR_SUCCESS;
    6886             : }
    6887             : 
    6888           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddPort(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddPort *r)
    6889             : {
    6890             :         uint32_t _ptr_pName;
    6891           0 :         uint32_t size_pName_1 = 0;
    6892           0 :         uint32_t length_pName_1 = 0;
    6893           0 :         uint32_t size_pMonitorName_1 = 0;
    6894           0 :         uint32_t length_pMonitorName_1 = 0;
    6895           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    6896           0 :         TALLOC_CTX *_mem_save_pPortContainer_0 = NULL;
    6897           0 :         TALLOC_CTX *_mem_save_pPortVarContainer_0 = NULL;
    6898           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    6899           0 :         if (flags & NDR_IN) {
    6900           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    6901           0 :                 if (_ptr_pName) {
    6902           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    6903             :                 } else {
    6904           0 :                         r->in.pName = NULL;
    6905             :                 }
    6906           0 :                 if (r->in.pName) {
    6907           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6908           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    6909           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    6910           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    6911           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    6912           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    6913           0 :                         if (length_pName_1 > size_pName_1) {
    6914           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    6915             :                         }
    6916           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    6917           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    6918           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    6919             :                 }
    6920           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6921           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPortContainer);
    6922             :                 }
    6923           0 :                 _mem_save_pPortContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6924           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pPortContainer, LIBNDR_FLAG_REF_ALLOC);
    6925           0 :                 NDR_CHECK(ndr_pull_spoolss_SetPortInfoContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPortContainer));
    6926           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPortContainer_0, LIBNDR_FLAG_REF_ALLOC);
    6927           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    6928           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPortVarContainer);
    6929             :                 }
    6930           0 :                 _mem_save_pPortVarContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    6931           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pPortVarContainer, LIBNDR_FLAG_REF_ALLOC);
    6932           0 :                 NDR_CHECK(ndr_pull_spoolss_PortVarContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPortVarContainer));
    6933           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPortVarContainer_0, LIBNDR_FLAG_REF_ALLOC);
    6934           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pMonitorName));
    6935           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pMonitorName));
    6936           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pMonitorName, &size_pMonitorName_1));
    6937           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pMonitorName, &length_pMonitorName_1));
    6938           0 :                 if (length_pMonitorName_1 > size_pMonitorName_1) {
    6939           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pMonitorName_1, length_pMonitorName_1);
    6940             :                 }
    6941           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pMonitorName_1, sizeof(uint16_t)));
    6942           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pMonitorName, length_pMonitorName_1, sizeof(uint16_t), CH_UTF16));
    6943             :         }
    6944           0 :         if (flags & NDR_OUT) {
    6945             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    6946             :                 if (r->in.pPortContainer == NULL) {
    6947             :                         NDR_PULL_ALLOC(ndr, r->in.pPortContainer);
    6948             :                         NDR_ZERO_STRUCTP(r->in.pPortContainer);
    6949             :                 }
    6950             :                 if (r->in.pPortVarContainer == NULL) {
    6951             :                         NDR_PULL_ALLOC(ndr, r->in.pPortVarContainer);
    6952             :                         NDR_ZERO_STRUCTP(r->in.pPortVarContainer);
    6953             :                 }
    6954             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    6955           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    6956             :         }
    6957           0 :         return NDR_ERR_SUCCESS;
    6958             : }
    6959             : 
    6960           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddPort(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddPort *r)
    6961             : {
    6962           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddPort");
    6963           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    6964           0 :         ndr->depth++;
    6965           0 :         if (flags & NDR_SET_VALUES) {
    6966           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    6967             :         }
    6968           0 :         if (flags & NDR_IN) {
    6969           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddPort");
    6970           0 :                 ndr->depth++;
    6971           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    6972           0 :                 ndr->depth++;
    6973           0 :                 if (r->in.pName) {
    6974           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    6975             :                 }
    6976           0 :                 ndr->depth--;
    6977           0 :                 ndr_print_ptr(ndr, "pPortContainer", r->in.pPortContainer);
    6978           0 :                 ndr->depth++;
    6979           0 :                 ndr_print_spoolss_SetPortInfoContainer(ndr, "pPortContainer", r->in.pPortContainer);
    6980           0 :                 ndr->depth--;
    6981           0 :                 ndr_print_ptr(ndr, "pPortVarContainer", r->in.pPortVarContainer);
    6982           0 :                 ndr->depth++;
    6983           0 :                 ndr_print_spoolss_PortVarContainer(ndr, "pPortVarContainer", r->in.pPortVarContainer);
    6984           0 :                 ndr->depth--;
    6985           0 :                 ndr_print_ptr(ndr, "pMonitorName", r->in.pMonitorName);
    6986           0 :                 ndr->depth++;
    6987           0 :                 ndr_print_string(ndr, "pMonitorName", r->in.pMonitorName);
    6988           0 :                 ndr->depth--;
    6989           0 :                 ndr->depth--;
    6990             :         }
    6991           0 :         if (flags & NDR_OUT) {
    6992           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddPort");
    6993           0 :                 ndr->depth++;
    6994           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    6995           0 :                 ndr->depth--;
    6996             :         }
    6997           0 :         ndr->depth--;
    6998             : }
    6999             : 
    7000           0 : static enum ndr_err_code ndr_push_winspool_AsyncSetPort(struct ndr_push *ndr, int flags, const struct winspool_AsyncSetPort *r)
    7001             : {
    7002           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    7003           0 :         if (flags & NDR_IN) {
    7004           0 :                 if (r->in.pPortContainer == NULL) {
    7005           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7006             :                 }
    7007           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    7008           0 :                 if (r->in.pName) {
    7009           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    7010           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7011           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    7012           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7013             :                 }
    7014           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPortName));
    7015           0 :                 if (r->in.pPortName) {
    7016           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPortName, CH_UTF16)));
    7017           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7018           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPortName, CH_UTF16)));
    7019           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPortName, ndr_charset_length(r->in.pPortName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7020             :                 }
    7021           0 :                 NDR_CHECK(ndr_push_spoolss_SetPortInfoContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPortContainer));
    7022             :         }
    7023           0 :         if (flags & NDR_OUT) {
    7024           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    7025             :         }
    7026           0 :         return NDR_ERR_SUCCESS;
    7027             : }
    7028             : 
    7029           0 : static enum ndr_err_code ndr_pull_winspool_AsyncSetPort(struct ndr_pull *ndr, int flags, struct winspool_AsyncSetPort *r)
    7030             : {
    7031             :         uint32_t _ptr_pName;
    7032           0 :         uint32_t size_pName_1 = 0;
    7033           0 :         uint32_t length_pName_1 = 0;
    7034             :         uint32_t _ptr_pPortName;
    7035           0 :         uint32_t size_pPortName_1 = 0;
    7036           0 :         uint32_t length_pPortName_1 = 0;
    7037           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    7038           0 :         TALLOC_CTX *_mem_save_pPortName_0 = NULL;
    7039           0 :         TALLOC_CTX *_mem_save_pPortContainer_0 = NULL;
    7040           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    7041           0 :         if (flags & NDR_IN) {
    7042           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    7043           0 :                 if (_ptr_pName) {
    7044           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    7045             :                 } else {
    7046           0 :                         r->in.pName = NULL;
    7047             :                 }
    7048           0 :                 if (r->in.pName) {
    7049           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7050           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    7051           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    7052           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    7053           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    7054           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    7055           0 :                         if (length_pName_1 > size_pName_1) {
    7056           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    7057             :                         }
    7058           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    7059           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    7060           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    7061             :                 }
    7062           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPortName));
    7063           0 :                 if (_ptr_pPortName) {
    7064           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPortName);
    7065             :                 } else {
    7066           0 :                         r->in.pPortName = NULL;
    7067             :                 }
    7068           0 :                 if (r->in.pPortName) {
    7069           0 :                         _mem_save_pPortName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7070           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPortName, 0);
    7071           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPortName));
    7072           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPortName));
    7073           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPortName, &size_pPortName_1));
    7074           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPortName, &length_pPortName_1));
    7075           0 :                         if (length_pPortName_1 > size_pPortName_1) {
    7076           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPortName_1, length_pPortName_1);
    7077             :                         }
    7078           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pPortName_1, sizeof(uint16_t)));
    7079           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPortName, length_pPortName_1, sizeof(uint16_t), CH_UTF16));
    7080           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPortName_0, 0);
    7081             :                 }
    7082           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    7083           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPortContainer);
    7084             :                 }
    7085           0 :                 _mem_save_pPortContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7086           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pPortContainer, LIBNDR_FLAG_REF_ALLOC);
    7087           0 :                 NDR_CHECK(ndr_pull_spoolss_SetPortInfoContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pPortContainer));
    7088           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPortContainer_0, LIBNDR_FLAG_REF_ALLOC);
    7089             :         }
    7090           0 :         if (flags & NDR_OUT) {
    7091             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    7092             :                 if (r->in.pPortContainer == NULL) {
    7093             :                         NDR_PULL_ALLOC(ndr, r->in.pPortContainer);
    7094             :                         NDR_ZERO_STRUCTP(r->in.pPortContainer);
    7095             :                 }
    7096             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    7097           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    7098             :         }
    7099           0 :         return NDR_ERR_SUCCESS;
    7100             : }
    7101             : 
    7102           0 : _PUBLIC_ void ndr_print_winspool_AsyncSetPort(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncSetPort *r)
    7103             : {
    7104           0 :         ndr_print_struct(ndr, name, "winspool_AsyncSetPort");
    7105           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    7106           0 :         ndr->depth++;
    7107           0 :         if (flags & NDR_SET_VALUES) {
    7108           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    7109             :         }
    7110           0 :         if (flags & NDR_IN) {
    7111           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncSetPort");
    7112           0 :                 ndr->depth++;
    7113           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    7114           0 :                 ndr->depth++;
    7115           0 :                 if (r->in.pName) {
    7116           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    7117             :                 }
    7118           0 :                 ndr->depth--;
    7119           0 :                 ndr_print_ptr(ndr, "pPortName", r->in.pPortName);
    7120           0 :                 ndr->depth++;
    7121           0 :                 if (r->in.pPortName) {
    7122           0 :                         ndr_print_string(ndr, "pPortName", r->in.pPortName);
    7123             :                 }
    7124           0 :                 ndr->depth--;
    7125           0 :                 ndr_print_ptr(ndr, "pPortContainer", r->in.pPortContainer);
    7126           0 :                 ndr->depth++;
    7127           0 :                 ndr_print_spoolss_SetPortInfoContainer(ndr, "pPortContainer", r->in.pPortContainer);
    7128           0 :                 ndr->depth--;
    7129           0 :                 ndr->depth--;
    7130             :         }
    7131           0 :         if (flags & NDR_OUT) {
    7132           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncSetPort");
    7133           0 :                 ndr->depth++;
    7134           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    7135           0 :                 ndr->depth--;
    7136             :         }
    7137           0 :         ndr->depth--;
    7138             : }
    7139             : 
    7140           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddMonitor(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddMonitor *r)
    7141             : {
    7142           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    7143           0 :         if (flags & NDR_IN) {
    7144           0 :                 if (r->in.pMonitorContainer == NULL) {
    7145           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7146             :                 }
    7147           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Name));
    7148           0 :                 if (r->in.Name) {
    7149           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Name, CH_UTF16)));
    7150           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7151           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Name, CH_UTF16)));
    7152           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Name, ndr_charset_length(r->in.Name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7153             :                 }
    7154           0 :                 NDR_CHECK(ndr_push_spoolss_MonitorContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pMonitorContainer));
    7155             :         }
    7156           0 :         if (flags & NDR_OUT) {
    7157           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    7158             :         }
    7159           0 :         return NDR_ERR_SUCCESS;
    7160             : }
    7161             : 
    7162           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddMonitor(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddMonitor *r)
    7163             : {
    7164             :         uint32_t _ptr_Name;
    7165           0 :         uint32_t size_Name_1 = 0;
    7166           0 :         uint32_t length_Name_1 = 0;
    7167           0 :         TALLOC_CTX *_mem_save_Name_0 = NULL;
    7168           0 :         TALLOC_CTX *_mem_save_pMonitorContainer_0 = NULL;
    7169           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    7170           0 :         if (flags & NDR_IN) {
    7171           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Name));
    7172           0 :                 if (_ptr_Name) {
    7173           0 :                         NDR_PULL_ALLOC(ndr, r->in.Name);
    7174             :                 } else {
    7175           0 :                         r->in.Name = NULL;
    7176             :                 }
    7177           0 :                 if (r->in.Name) {
    7178           0 :                         _mem_save_Name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7179           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.Name, 0);
    7180           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Name));
    7181           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Name));
    7182           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.Name, &size_Name_1));
    7183           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.Name, &length_Name_1));
    7184           0 :                         if (length_Name_1 > size_Name_1) {
    7185           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_Name_1, length_Name_1);
    7186             :                         }
    7187           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_Name_1, sizeof(uint16_t)));
    7188           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Name, length_Name_1, sizeof(uint16_t), CH_UTF16));
    7189           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Name_0, 0);
    7190             :                 }
    7191           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    7192           0 :                         NDR_PULL_ALLOC(ndr, r->in.pMonitorContainer);
    7193             :                 }
    7194           0 :                 _mem_save_pMonitorContainer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7195           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->in.pMonitorContainer, LIBNDR_FLAG_REF_ALLOC);
    7196           0 :                 NDR_CHECK(ndr_pull_spoolss_MonitorContainer(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.pMonitorContainer));
    7197           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pMonitorContainer_0, LIBNDR_FLAG_REF_ALLOC);
    7198             :         }
    7199           0 :         if (flags & NDR_OUT) {
    7200             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    7201             :                 if (r->in.pMonitorContainer == NULL) {
    7202             :                         NDR_PULL_ALLOC(ndr, r->in.pMonitorContainer);
    7203             :                         NDR_ZERO_STRUCTP(r->in.pMonitorContainer);
    7204             :                 }
    7205             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    7206           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    7207             :         }
    7208           0 :         return NDR_ERR_SUCCESS;
    7209             : }
    7210             : 
    7211           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddMonitor(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddMonitor *r)
    7212             : {
    7213           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddMonitor");
    7214           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    7215           0 :         ndr->depth++;
    7216           0 :         if (flags & NDR_SET_VALUES) {
    7217           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    7218             :         }
    7219           0 :         if (flags & NDR_IN) {
    7220           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncAddMonitor");
    7221           0 :                 ndr->depth++;
    7222           0 :                 ndr_print_ptr(ndr, "Name", r->in.Name);
    7223           0 :                 ndr->depth++;
    7224           0 :                 if (r->in.Name) {
    7225           0 :                         ndr_print_string(ndr, "Name", r->in.Name);
    7226             :                 }
    7227           0 :                 ndr->depth--;
    7228           0 :                 ndr_print_ptr(ndr, "pMonitorContainer", r->in.pMonitorContainer);
    7229           0 :                 ndr->depth++;
    7230           0 :                 ndr_print_spoolss_MonitorContainer(ndr, "pMonitorContainer", r->in.pMonitorContainer);
    7231           0 :                 ndr->depth--;
    7232           0 :                 ndr->depth--;
    7233             :         }
    7234           0 :         if (flags & NDR_OUT) {
    7235           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncAddMonitor");
    7236           0 :                 ndr->depth++;
    7237           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    7238           0 :                 ndr->depth--;
    7239             :         }
    7240           0 :         ndr->depth--;
    7241             : }
    7242             : 
    7243           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeleteMonitor(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeleteMonitor *r)
    7244             : {
    7245           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    7246           0 :         if (flags & NDR_IN) {
    7247           0 :                 if (r->in.pMonitorName == NULL) {
    7248           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7249             :                 }
    7250           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Name));
    7251           0 :                 if (r->in.Name) {
    7252           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Name, CH_UTF16)));
    7253           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7254           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Name, CH_UTF16)));
    7255           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Name, ndr_charset_length(r->in.Name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7256             :                 }
    7257           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    7258           0 :                 if (r->in.pEnvironment) {
    7259           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    7260           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7261           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    7262           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7263             :                 }
    7264           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pMonitorName, CH_UTF16)));
    7265           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7266           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pMonitorName, CH_UTF16)));
    7267           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pMonitorName, ndr_charset_length(r->in.pMonitorName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7268             :         }
    7269           0 :         if (flags & NDR_OUT) {
    7270           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    7271             :         }
    7272           0 :         return NDR_ERR_SUCCESS;
    7273             : }
    7274             : 
    7275           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeleteMonitor(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeleteMonitor *r)
    7276             : {
    7277             :         uint32_t _ptr_Name;
    7278           0 :         uint32_t size_Name_1 = 0;
    7279           0 :         uint32_t length_Name_1 = 0;
    7280             :         uint32_t _ptr_pEnvironment;
    7281           0 :         uint32_t size_pEnvironment_1 = 0;
    7282           0 :         uint32_t length_pEnvironment_1 = 0;
    7283           0 :         uint32_t size_pMonitorName_1 = 0;
    7284           0 :         uint32_t length_pMonitorName_1 = 0;
    7285           0 :         TALLOC_CTX *_mem_save_Name_0 = NULL;
    7286           0 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    7287           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    7288           0 :         if (flags & NDR_IN) {
    7289           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Name));
    7290           0 :                 if (_ptr_Name) {
    7291           0 :                         NDR_PULL_ALLOC(ndr, r->in.Name);
    7292             :                 } else {
    7293           0 :                         r->in.Name = NULL;
    7294             :                 }
    7295           0 :                 if (r->in.Name) {
    7296           0 :                         _mem_save_Name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7297           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.Name, 0);
    7298           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Name));
    7299           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Name));
    7300           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.Name, &size_Name_1));
    7301           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.Name, &length_Name_1));
    7302           0 :                         if (length_Name_1 > size_Name_1) {
    7303           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_Name_1, length_Name_1);
    7304             :                         }
    7305           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_Name_1, sizeof(uint16_t)));
    7306           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Name, length_Name_1, sizeof(uint16_t), CH_UTF16));
    7307           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Name_0, 0);
    7308             :                 }
    7309           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    7310           0 :                 if (_ptr_pEnvironment) {
    7311           0 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    7312             :                 } else {
    7313           0 :                         r->in.pEnvironment = NULL;
    7314             :                 }
    7315           0 :                 if (r->in.pEnvironment) {
    7316           0 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7317           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    7318           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    7319           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    7320           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    7321           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    7322           0 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    7323           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    7324             :                         }
    7325           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    7326           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    7327           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    7328             :                 }
    7329           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pMonitorName));
    7330           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pMonitorName));
    7331           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pMonitorName, &size_pMonitorName_1));
    7332           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pMonitorName, &length_pMonitorName_1));
    7333           0 :                 if (length_pMonitorName_1 > size_pMonitorName_1) {
    7334           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pMonitorName_1, length_pMonitorName_1);
    7335             :                 }
    7336           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pMonitorName_1, sizeof(uint16_t)));
    7337           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pMonitorName, length_pMonitorName_1, sizeof(uint16_t), CH_UTF16));
    7338             :         }
    7339           0 :         if (flags & NDR_OUT) {
    7340             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    7341             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    7342           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    7343             :         }
    7344           0 :         return NDR_ERR_SUCCESS;
    7345             : }
    7346             : 
    7347           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeleteMonitor(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeleteMonitor *r)
    7348             : {
    7349           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeleteMonitor");
    7350           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    7351           0 :         ndr->depth++;
    7352           0 :         if (flags & NDR_SET_VALUES) {
    7353           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    7354             :         }
    7355           0 :         if (flags & NDR_IN) {
    7356           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeleteMonitor");
    7357           0 :                 ndr->depth++;
    7358           0 :                 ndr_print_ptr(ndr, "Name", r->in.Name);
    7359           0 :                 ndr->depth++;
    7360           0 :                 if (r->in.Name) {
    7361           0 :                         ndr_print_string(ndr, "Name", r->in.Name);
    7362             :                 }
    7363           0 :                 ndr->depth--;
    7364           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    7365           0 :                 ndr->depth++;
    7366           0 :                 if (r->in.pEnvironment) {
    7367           0 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    7368             :                 }
    7369           0 :                 ndr->depth--;
    7370           0 :                 ndr_print_ptr(ndr, "pMonitorName", r->in.pMonitorName);
    7371           0 :                 ndr->depth++;
    7372           0 :                 ndr_print_string(ndr, "pMonitorName", r->in.pMonitorName);
    7373           0 :                 ndr->depth--;
    7374           0 :                 ndr->depth--;
    7375             :         }
    7376           0 :         if (flags & NDR_OUT) {
    7377           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeleteMonitor");
    7378           0 :                 ndr->depth++;
    7379           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    7380           0 :                 ndr->depth--;
    7381             :         }
    7382           0 :         ndr->depth--;
    7383             : }
    7384             : 
    7385           0 : static enum ndr_err_code ndr_push_winspool_AsyncDeletePrintProcessor(struct ndr_push *ndr, int flags, const struct winspool_AsyncDeletePrintProcessor *r)
    7386             : {
    7387           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    7388           0 :         if (flags & NDR_IN) {
    7389           0 :                 if (r->in.pPrintProcessorName == NULL) {
    7390           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7391             :                 }
    7392           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.Name));
    7393           0 :                 if (r->in.Name) {
    7394           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Name, CH_UTF16)));
    7395           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7396           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.Name, CH_UTF16)));
    7397           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.Name, ndr_charset_length(r->in.Name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7398             :                 }
    7399           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pEnvironment));
    7400           0 :                 if (r->in.pEnvironment) {
    7401           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    7402           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7403           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pEnvironment, CH_UTF16)));
    7404           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pEnvironment, ndr_charset_length(r->in.pEnvironment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7405             :                 }
    7406           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16)));
    7407           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7408           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16)));
    7409           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPrintProcessorName, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7410             :         }
    7411           0 :         if (flags & NDR_OUT) {
    7412           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    7413             :         }
    7414           0 :         return NDR_ERR_SUCCESS;
    7415             : }
    7416             : 
    7417           0 : static enum ndr_err_code ndr_pull_winspool_AsyncDeletePrintProcessor(struct ndr_pull *ndr, int flags, struct winspool_AsyncDeletePrintProcessor *r)
    7418             : {
    7419             :         uint32_t _ptr_Name;
    7420           0 :         uint32_t size_Name_1 = 0;
    7421           0 :         uint32_t length_Name_1 = 0;
    7422             :         uint32_t _ptr_pEnvironment;
    7423           0 :         uint32_t size_pEnvironment_1 = 0;
    7424           0 :         uint32_t length_pEnvironment_1 = 0;
    7425           0 :         uint32_t size_pPrintProcessorName_1 = 0;
    7426           0 :         uint32_t length_pPrintProcessorName_1 = 0;
    7427           0 :         TALLOC_CTX *_mem_save_Name_0 = NULL;
    7428           0 :         TALLOC_CTX *_mem_save_pEnvironment_0 = NULL;
    7429           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    7430           0 :         if (flags & NDR_IN) {
    7431           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Name));
    7432           0 :                 if (_ptr_Name) {
    7433           0 :                         NDR_PULL_ALLOC(ndr, r->in.Name);
    7434             :                 } else {
    7435           0 :                         r->in.Name = NULL;
    7436             :                 }
    7437           0 :                 if (r->in.Name) {
    7438           0 :                         _mem_save_Name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7439           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.Name, 0);
    7440           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.Name));
    7441           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.Name));
    7442           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.Name, &size_Name_1));
    7443           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.Name, &length_Name_1));
    7444           0 :                         if (length_Name_1 > size_Name_1) {
    7445           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_Name_1, length_Name_1);
    7446             :                         }
    7447           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_Name_1, sizeof(uint16_t)));
    7448           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.Name, length_Name_1, sizeof(uint16_t), CH_UTF16));
    7449           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Name_0, 0);
    7450             :                 }
    7451           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pEnvironment));
    7452           0 :                 if (_ptr_pEnvironment) {
    7453           0 :                         NDR_PULL_ALLOC(ndr, r->in.pEnvironment);
    7454             :                 } else {
    7455           0 :                         r->in.pEnvironment = NULL;
    7456             :                 }
    7457           0 :                 if (r->in.pEnvironment) {
    7458           0 :                         _mem_save_pEnvironment_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7459           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pEnvironment, 0);
    7460           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pEnvironment));
    7461           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pEnvironment));
    7462           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pEnvironment, &size_pEnvironment_1));
    7463           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pEnvironment, &length_pEnvironment_1));
    7464           0 :                         if (length_pEnvironment_1 > size_pEnvironment_1) {
    7465           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pEnvironment_1, length_pEnvironment_1);
    7466             :                         }
    7467           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pEnvironment_1, sizeof(uint16_t)));
    7468           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pEnvironment, length_pEnvironment_1, sizeof(uint16_t), CH_UTF16));
    7469           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pEnvironment_0, 0);
    7470             :                 }
    7471           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrintProcessorName));
    7472           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPrintProcessorName));
    7473           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPrintProcessorName, &size_pPrintProcessorName_1));
    7474           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPrintProcessorName, &length_pPrintProcessorName_1));
    7475           0 :                 if (length_pPrintProcessorName_1 > size_pPrintProcessorName_1) {
    7476           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPrintProcessorName_1, length_pPrintProcessorName_1);
    7477             :                 }
    7478           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pPrintProcessorName_1, sizeof(uint16_t)));
    7479           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPrintProcessorName, length_pPrintProcessorName_1, sizeof(uint16_t), CH_UTF16));
    7480             :         }
    7481           0 :         if (flags & NDR_OUT) {
    7482             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    7483             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    7484           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    7485             :         }
    7486           0 :         return NDR_ERR_SUCCESS;
    7487             : }
    7488             : 
    7489           0 : _PUBLIC_ void ndr_print_winspool_AsyncDeletePrintProcessor(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncDeletePrintProcessor *r)
    7490             : {
    7491           0 :         ndr_print_struct(ndr, name, "winspool_AsyncDeletePrintProcessor");
    7492           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    7493           0 :         ndr->depth++;
    7494           0 :         if (flags & NDR_SET_VALUES) {
    7495           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    7496             :         }
    7497           0 :         if (flags & NDR_IN) {
    7498           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncDeletePrintProcessor");
    7499           0 :                 ndr->depth++;
    7500           0 :                 ndr_print_ptr(ndr, "Name", r->in.Name);
    7501           0 :                 ndr->depth++;
    7502           0 :                 if (r->in.Name) {
    7503           0 :                         ndr_print_string(ndr, "Name", r->in.Name);
    7504             :                 }
    7505           0 :                 ndr->depth--;
    7506           0 :                 ndr_print_ptr(ndr, "pEnvironment", r->in.pEnvironment);
    7507           0 :                 ndr->depth++;
    7508           0 :                 if (r->in.pEnvironment) {
    7509           0 :                         ndr_print_string(ndr, "pEnvironment", r->in.pEnvironment);
    7510             :                 }
    7511           0 :                 ndr->depth--;
    7512           0 :                 ndr_print_ptr(ndr, "pPrintProcessorName", r->in.pPrintProcessorName);
    7513           0 :                 ndr->depth++;
    7514           0 :                 ndr_print_string(ndr, "pPrintProcessorName", r->in.pPrintProcessorName);
    7515           0 :                 ndr->depth--;
    7516           0 :                 ndr->depth--;
    7517             :         }
    7518           0 :         if (flags & NDR_OUT) {
    7519           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncDeletePrintProcessor");
    7520           0 :                 ndr->depth++;
    7521           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    7522           0 :                 ndr->depth--;
    7523             :         }
    7524           0 :         ndr->depth--;
    7525             : }
    7526             : 
    7527           0 : static enum ndr_err_code ndr_push_winspool_AsyncEnumPrintProcessorDatatypes(struct ndr_push *ndr, int flags, const struct winspool_AsyncEnumPrintProcessorDatatypes *r)
    7528             : {
    7529           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    7530           0 :         if (flags & NDR_IN) {
    7531           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pName));
    7532           0 :                 if (r->in.pName) {
    7533           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    7534           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7535           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pName, CH_UTF16)));
    7536           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pName, ndr_charset_length(r->in.pName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7537             :                 }
    7538           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pPrintProcessorName));
    7539           0 :                 if (r->in.pPrintProcessorName) {
    7540           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16)));
    7541           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7542           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16)));
    7543           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPrintProcessorName, ndr_charset_length(r->in.pPrintProcessorName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7544             :                 }
    7545           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.Level));
    7546           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pDatatypes));
    7547           0 :                 if (r->in.pDatatypes) {
    7548           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    7549           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.pDatatypes, r->in.cbBuf));
    7550             :                 }
    7551           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.cbBuf));
    7552             :         }
    7553           0 :         if (flags & NDR_OUT) {
    7554           0 :                 if (r->out.pcbNeeded == NULL) {
    7555           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7556             :                 }
    7557           0 :                 if (r->out.pcReturned == NULL) {
    7558           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7559             :                 }
    7560           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.pDatatypes));
    7561           0 :                 if (r->out.pDatatypes) {
    7562           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->in.cbBuf));
    7563           0 :                         NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.pDatatypes, r->in.cbBuf));
    7564             :                 }
    7565           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcbNeeded));
    7566           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.pcReturned));
    7567           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    7568             :         }
    7569           0 :         return NDR_ERR_SUCCESS;
    7570             : }
    7571             : 
    7572           0 : static enum ndr_err_code ndr_pull_winspool_AsyncEnumPrintProcessorDatatypes(struct ndr_pull *ndr, int flags, struct winspool_AsyncEnumPrintProcessorDatatypes *r)
    7573             : {
    7574             :         uint32_t _ptr_pName;
    7575           0 :         uint32_t size_pName_1 = 0;
    7576           0 :         uint32_t length_pName_1 = 0;
    7577             :         uint32_t _ptr_pPrintProcessorName;
    7578           0 :         uint32_t size_pPrintProcessorName_1 = 0;
    7579           0 :         uint32_t length_pPrintProcessorName_1 = 0;
    7580             :         uint32_t _ptr_pDatatypes;
    7581           0 :         uint32_t size_pDatatypes_1 = 0;
    7582           0 :         TALLOC_CTX *_mem_save_pName_0 = NULL;
    7583           0 :         TALLOC_CTX *_mem_save_pPrintProcessorName_0 = NULL;
    7584           0 :         TALLOC_CTX *_mem_save_pDatatypes_0 = NULL;
    7585           0 :         TALLOC_CTX *_mem_save_pcbNeeded_0 = NULL;
    7586           0 :         TALLOC_CTX *_mem_save_pcReturned_0 = NULL;
    7587           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    7588           0 :         if (flags & NDR_IN) {
    7589           0 :                 NDR_ZERO_STRUCT(r->out);
    7590             : 
    7591           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pName));
    7592           0 :                 if (_ptr_pName) {
    7593           0 :                         NDR_PULL_ALLOC(ndr, r->in.pName);
    7594             :                 } else {
    7595           0 :                         r->in.pName = NULL;
    7596             :                 }
    7597           0 :                 if (r->in.pName) {
    7598           0 :                         _mem_save_pName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7599           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pName, 0);
    7600           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pName));
    7601           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pName));
    7602           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pName, &size_pName_1));
    7603           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pName, &length_pName_1));
    7604           0 :                         if (length_pName_1 > size_pName_1) {
    7605           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pName_1, length_pName_1);
    7606             :                         }
    7607           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pName_1, sizeof(uint16_t)));
    7608           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pName, length_pName_1, sizeof(uint16_t), CH_UTF16));
    7609           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pName_0, 0);
    7610             :                 }
    7611           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pPrintProcessorName));
    7612           0 :                 if (_ptr_pPrintProcessorName) {
    7613           0 :                         NDR_PULL_ALLOC(ndr, r->in.pPrintProcessorName);
    7614             :                 } else {
    7615           0 :                         r->in.pPrintProcessorName = NULL;
    7616             :                 }
    7617           0 :                 if (r->in.pPrintProcessorName) {
    7618           0 :                         _mem_save_pPrintProcessorName_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7619           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pPrintProcessorName, 0);
    7620           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrintProcessorName));
    7621           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPrintProcessorName));
    7622           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPrintProcessorName, &size_pPrintProcessorName_1));
    7623           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPrintProcessorName, &length_pPrintProcessorName_1));
    7624           0 :                         if (length_pPrintProcessorName_1 > size_pPrintProcessorName_1) {
    7625           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPrintProcessorName_1, length_pPrintProcessorName_1);
    7626             :                         }
    7627           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pPrintProcessorName_1, sizeof(uint16_t)));
    7628           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPrintProcessorName, length_pPrintProcessorName_1, sizeof(uint16_t), CH_UTF16));
    7629           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pPrintProcessorName_0, 0);
    7630             :                 }
    7631           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.Level));
    7632           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDatatypes));
    7633           0 :                 if (_ptr_pDatatypes) {
    7634           0 :                         NDR_PULL_ALLOC(ndr, r->in.pDatatypes);
    7635             :                 } else {
    7636           0 :                         r->in.pDatatypes = NULL;
    7637             :                 }
    7638           0 :                 if (r->in.pDatatypes) {
    7639           0 :                         _mem_save_pDatatypes_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7640           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pDatatypes, 0);
    7641           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pDatatypes));
    7642           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->in.pDatatypes, &size_pDatatypes_1));
    7643           0 :                         NDR_PULL_ALLOC_N(ndr, r->in.pDatatypes, size_pDatatypes_1);
    7644           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.pDatatypes, size_pDatatypes_1));
    7645           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDatatypes_0, 0);
    7646             :                 }
    7647           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.cbBuf));
    7648           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    7649           0 :                 NDR_ZERO_STRUCTP(r->out.pcbNeeded);
    7650           0 :                 NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    7651           0 :                 NDR_ZERO_STRUCTP(r->out.pcReturned);
    7652           0 :                 if (r->in.pDatatypes) {
    7653           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->in.pDatatypes, r->in.cbBuf));
    7654             :                 }
    7655             :         }
    7656           0 :         if (flags & NDR_OUT) {
    7657             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    7658             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    7659           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pDatatypes));
    7660           0 :                 if (_ptr_pDatatypes) {
    7661           0 :                         NDR_PULL_ALLOC(ndr, r->out.pDatatypes);
    7662             :                 } else {
    7663           0 :                         r->out.pDatatypes = NULL;
    7664             :                 }
    7665           0 :                 if (r->out.pDatatypes) {
    7666           0 :                         _mem_save_pDatatypes_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7667           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->out.pDatatypes, 0);
    7668           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->out.pDatatypes));
    7669           0 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->out.pDatatypes, &size_pDatatypes_1));
    7670           0 :                         NDR_PULL_ALLOC_N(ndr, r->out.pDatatypes, size_pDatatypes_1);
    7671           0 :                         NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.pDatatypes, size_pDatatypes_1));
    7672           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pDatatypes_0, 0);
    7673             :                 }
    7674           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    7675           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcbNeeded);
    7676             :                 }
    7677           0 :                 _mem_save_pcbNeeded_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7678           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcbNeeded, LIBNDR_FLAG_REF_ALLOC);
    7679           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcbNeeded));
    7680           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbNeeded_0, LIBNDR_FLAG_REF_ALLOC);
    7681           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    7682           0 :                         NDR_PULL_ALLOC(ndr, r->out.pcReturned);
    7683             :                 }
    7684           0 :                 _mem_save_pcReturned_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7685           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.pcReturned, LIBNDR_FLAG_REF_ALLOC);
    7686           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.pcReturned));
    7687           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcReturned_0, LIBNDR_FLAG_REF_ALLOC);
    7688           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    7689           0 :                 if (r->out.pDatatypes) {
    7690           0 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->out.pDatatypes, r->in.cbBuf));
    7691             :                 }
    7692             :         }
    7693           0 :         return NDR_ERR_SUCCESS;
    7694             : }
    7695             : 
    7696           0 : _PUBLIC_ void ndr_print_winspool_AsyncEnumPrintProcessorDatatypes(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncEnumPrintProcessorDatatypes *r)
    7697             : {
    7698           0 :         ndr_print_struct(ndr, name, "winspool_AsyncEnumPrintProcessorDatatypes");
    7699           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    7700           0 :         ndr->depth++;
    7701           0 :         if (flags & NDR_SET_VALUES) {
    7702           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    7703             :         }
    7704           0 :         if (flags & NDR_IN) {
    7705           0 :                 ndr_print_struct(ndr, "in", "winspool_AsyncEnumPrintProcessorDatatypes");
    7706           0 :                 ndr->depth++;
    7707           0 :                 ndr_print_ptr(ndr, "pName", r->in.pName);
    7708           0 :                 ndr->depth++;
    7709           0 :                 if (r->in.pName) {
    7710           0 :                         ndr_print_string(ndr, "pName", r->in.pName);
    7711             :                 }
    7712           0 :                 ndr->depth--;
    7713           0 :                 ndr_print_ptr(ndr, "pPrintProcessorName", r->in.pPrintProcessorName);
    7714           0 :                 ndr->depth++;
    7715           0 :                 if (r->in.pPrintProcessorName) {
    7716           0 :                         ndr_print_string(ndr, "pPrintProcessorName", r->in.pPrintProcessorName);
    7717             :                 }
    7718           0 :                 ndr->depth--;
    7719           0 :                 ndr_print_uint32(ndr, "Level", r->in.Level);
    7720           0 :                 ndr_print_ptr(ndr, "pDatatypes", r->in.pDatatypes);
    7721           0 :                 ndr->depth++;
    7722           0 :                 if (r->in.pDatatypes) {
    7723           0 :                         ndr_print_array_uint8(ndr, "pDatatypes", r->in.pDatatypes, r->in.cbBuf);
    7724             :                 }
    7725           0 :                 ndr->depth--;
    7726           0 :                 ndr_print_uint32(ndr, "cbBuf", r->in.cbBuf);
    7727           0 :                 ndr->depth--;
    7728             :         }
    7729           0 :         if (flags & NDR_OUT) {
    7730           0 :                 ndr_print_struct(ndr, "out", "winspool_AsyncEnumPrintProcessorDatatypes");
    7731           0 :                 ndr->depth++;
    7732           0 :                 ndr_print_ptr(ndr, "pDatatypes", r->out.pDatatypes);
    7733           0 :                 ndr->depth++;
    7734           0 :                 if (r->out.pDatatypes) {
    7735           0 :                         ndr_print_array_uint8(ndr, "pDatatypes", r->out.pDatatypes, r->in.cbBuf);
    7736             :                 }
    7737           0 :                 ndr->depth--;
    7738           0 :                 ndr_print_ptr(ndr, "pcbNeeded", r->out.pcbNeeded);
    7739           0 :                 ndr->depth++;
    7740           0 :                 ndr_print_uint32(ndr, "pcbNeeded", *r->out.pcbNeeded);
    7741           0 :                 ndr->depth--;
    7742           0 :                 ndr_print_ptr(ndr, "pcReturned", r->out.pcReturned);
    7743           0 :                 ndr->depth++;
    7744           0 :                 ndr_print_uint32(ndr, "pcReturned", *r->out.pcReturned);
    7745           0 :                 ndr->depth--;
    7746           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    7747           0 :                 ndr->depth--;
    7748             :         }
    7749           0 :         ndr->depth--;
    7750             : }
    7751             : 
    7752           0 : static enum ndr_err_code ndr_push_winspool_AsyncAddPerMachineConnection(struct ndr_push *ndr, int flags, const struct winspool_AsyncAddPerMachineConnection *r)
    7753             : {
    7754           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    7755           0 :         if (flags & NDR_IN) {
    7756           0 :                 if (r->in.pPrinterName == NULL) {
    7757           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7758             :                 }
    7759           0 :                 if (r->in.pPrintServer == NULL) {
    7760           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7761             :                 }
    7762           0 :                 if (r->in.pProvider == NULL) {
    7763           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    7764             :                 }
    7765           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.pServer));
    7766           0 :                 if (r->in.pServer) {
    7767           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pServer, CH_UTF16)));
    7768           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7769           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pServer, CH_UTF16)));
    7770           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pServer, ndr_charset_length(r->in.pServer, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7771             :                 }
    7772           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrinterName, CH_UTF16)));
    7773           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7774           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrinterName, CH_UTF16)));
    7775           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPrinterName, ndr_charset_length(r->in.pPrinterName, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7776           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintServer, CH_UTF16)));
    7777           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7778           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pPrintServer, CH_UTF16)));
    7779           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pPrintServer, ndr_charset_length(r->in.pPrintServer, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7780           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pProvider, CH_UTF16)));
    7781           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    7782           0 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.pProvider, CH_UTF16)));
    7783           0 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.pProvider, ndr_charset_length(r->in.pProvider, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    7784             :         }
    7785           0 :         if (flags & NDR_OUT) {
    7786           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    7787             :         }
    7788           0 :         return NDR_ERR_SUCCESS;
    7789             : }
    7790             : 
    7791           0 : static enum ndr_err_code ndr_pull_winspool_AsyncAddPerMachineConnection(struct ndr_pull *ndr, int flags, struct winspool_AsyncAddPerMachineConnection *r)
    7792             : {
    7793             :         uint32_t _ptr_pServer;
    7794           0 :         uint32_t size_pServer_1 = 0;
    7795           0 :         uint32_t length_pServer_1 = 0;
    7796           0 :         uint32_t size_pPrinterName_1 = 0;
    7797           0 :         uint32_t length_pPrinterName_1 = 0;
    7798           0 :         uint32_t size_pPrintServer_1 = 0;
    7799           0 :         uint32_t length_pPrintServer_1 = 0;
    7800           0 :         uint32_t size_pProvider_1 = 0;
    7801           0 :         uint32_t length_pProvider_1 = 0;
    7802           0 :         TALLOC_CTX *_mem_save_pServer_0 = NULL;
    7803           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    7804           0 :         if (flags & NDR_IN) {
    7805           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_pServer));
    7806           0 :                 if (_ptr_pServer) {
    7807           0 :                         NDR_PULL_ALLOC(ndr, r->in.pServer);
    7808             :                 } else {
    7809           0 :                         r->in.pServer = NULL;
    7810             :                 }
    7811           0 :                 if (r->in.pServer) {
    7812           0 :                         _mem_save_pServer_0 = NDR_PULL_GET_MEM_CTX(ndr);
    7813           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.pServer, 0);
    7814           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pServer));
    7815           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pServer));
    7816           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pServer, &size_pServer_1));
    7817           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pServer, &length_pServer_1));
    7818           0 :                         if (length_pServer_1 > size_pServer_1) {
    7819           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pServer_1, length_pServer_1);
    7820             :                         }
    7821           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_pServer_1, sizeof(uint16_t)));
    7822           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pServer, length_pServer_1, sizeof(uint16_t), CH_UTF16));
    7823           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pServer_0, 0);
    7824             :                 }
    7825           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrinterName));
    7826           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPrinterName));
    7827           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPrinterName, &size_pPrinterName_1));
    7828           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPrinterName, &length_pPrinterName_1));
    7829           0 :                 if (length_pPrinterName_1 > size_pPrinterName_1) {
    7830           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPrinterName_1, length_pPrinterName_1);
    7831             :                 }
    7832           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pPrinterName_1, sizeof(uint16_t)));
    7833           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPrinterName, length_pPrinterName_1, sizeof(uint16_t), CH_UTF16));
    7834           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pPrintServer));
    7835           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pPrintServer));
    7836           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pPrintServer, &size_pPrintServer_1));
    7837           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pPrintServer, &length_pPrintServer_1));
    7838           0 :                 if (length_pPrintServer_1 > size_pPrintServer_1) {
    7839           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pPrintServer_1, length_pPrintServer_1);
    7840             :                 }
    7841           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pPrintServer_1, sizeof(uint16_t)));
    7842           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pPrintServer, length_pPrintServer_1, sizeof(uint16_t), CH_UTF16));
    7843           0 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.pProvider));
    7844           0 :                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.pProvider));
    7845           0 :                 NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.pProvider, &size_pProvider_1));
    7846           0 :                 NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.pProvider, &length_pProvider_1));
    7847           0 :                 if (length_pProvider_1 > size_pProvider_1) {
    7848           0 :                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", size_pProvider_1, length_pProvider_1);
    7849             :                 }
    7850           0 :                 NDR_CHECK(ndr_check_string_terminator(ndr, length_pProvider_1, sizeof(uint16_t)));
    7851           0 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.pProvider, length_pProvider_1, sizeof(uint16_t), CH_UTF16));
    7852             :         }
    7853           0 :         if (flags & NDR_OUT) {
    7854             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    7855             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    7856           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    7857             :         }
    7858           0 :         return NDR_ERR_SUCCESS;
    7859             : }
    7860             : 
    7861           0 : _PUBLIC_ void ndr_print_winspool_AsyncAddPerMachineConnection(struct ndr_print *ndr, const char *name, int flags, const struct winspool_AsyncAddPerMachineConnection *r)
    7862             : {
    7863           0 :         ndr_print_struct(ndr, name, "winspool_AsyncAddPerMachineConnection");
    7864