Logo Search packages:      
Sourcecode: samba version File versions  Download package

ndr_spoolss.c

/* parser auto-generated by pidl */

#include "includes.h"
#include "../librpc/gen_ndr/ndr_spoolss.h"

#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_winreg.h"
static enum ndr_err_code ndr_push_spoolss_Time(struct ndr_push *ndr, int ndr_flags, const struct spoolss_Time *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 2));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->year));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->month));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->day_of_week));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->day));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->hour));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->minute));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->second));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->millisecond));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_Time(struct ndr_pull *ndr, int ndr_flags, struct spoolss_Time *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 2));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->year));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->month));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->day_of_week));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->day));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->hour));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->minute));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->second));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->millisecond));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_Time(struct ndr_print *ndr, const char *name, const struct spoolss_Time *r)
{
      ndr_print_struct(ndr, name, "spoolss_Time");
      ndr->depth++;
      ndr_print_uint16(ndr, "year", r->year);
      ndr_print_uint16(ndr, "month", r->month);
      ndr_print_uint16(ndr, "day_of_week", r->day_of_week);
      ndr_print_uint16(ndr, "day", r->day);
      ndr_print_uint16(ndr, "hour", r->hour);
      ndr_print_uint16(ndr, "minute", r->minute);
      ndr_print_uint16(ndr, "second", r->second);
      ndr_print_uint16(ndr, "millisecond", r->millisecond);
      ndr->depth--;
}

static size_t ndr_size_spoolss_Time(const struct spoolss_Time *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_Time, ic);
}

static enum ndr_err_code ndr_push_spoolss_TimeCtr(struct ndr_push *ndr, int ndr_flags, const struct spoolss_TimeCtr *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_spoolss_Time(r->time, ndr->iconv_convenience, ndr->flags)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->time));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->time) {
                  NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, r->time));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_TimeCtr(struct ndr_pull *ndr, int ndr_flags, struct spoolss_TimeCtr *r)
{
      uint32_t _ptr_time;
      TALLOC_CTX *_mem_save_time_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_time));
            if (_ptr_time) {
                  NDR_PULL_ALLOC(ndr, r->time);
            } else {
                  r->time = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->time) {
                  _mem_save_time_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->time, 0);
                  NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, r->time));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_time_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_TimeCtr(struct ndr_print *ndr, const char *name, const struct spoolss_TimeCtr *r)
{
      ndr_print_struct(ndr, name, "spoolss_TimeCtr");
      ndr->depth++;
      ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_Time(r->time, ndr->iconv_convenience, ndr->flags):r->size);
      ndr_print_ptr(ndr, "time", r->time);
      ndr->depth++;
      if (r->time) {
            ndr_print_spoolss_Time(ndr, "time", r->time);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_ProcessorArchitecture(struct ndr_push *ndr, int ndr_flags, enum spoolss_ProcessorArchitecture r)
{
      NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_ProcessorArchitecture(struct ndr_pull *ndr, int ndr_flags, enum spoolss_ProcessorArchitecture *r)
{
      uint16_t v;
      NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_ProcessorArchitecture(struct ndr_print *ndr, const char *name, enum spoolss_ProcessorArchitecture r)
{
      const char *val = NULL;

      switch (r) {
            case PROCESSOR_ARCHITECTURE_INTEL: val = "PROCESSOR_ARCHITECTURE_INTEL"; break;
            case PROCESSOR_ARCHITECTURE_IA64: val = "PROCESSOR_ARCHITECTURE_IA64"; break;
            case PROCESSOR_ARCHITECTURE_AMD64: val = "PROCESSOR_ARCHITECTURE_AMD64"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_ProcessorType(struct ndr_push *ndr, int ndr_flags, enum spoolss_ProcessorType r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_ProcessorType(struct ndr_pull *ndr, int ndr_flags, enum spoolss_ProcessorType *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_ProcessorType(struct ndr_print *ndr, const char *name, enum spoolss_ProcessorType r)
{
      const char *val = NULL;

      switch (r) {
            case PROCESSOR_INTEL_386: val = "PROCESSOR_INTEL_386"; break;
            case PROCESSOR_INTEL_486: val = "PROCESSOR_INTEL_486"; break;
            case PROCESSOR_INTEL_PENTIUM: val = "PROCESSOR_INTEL_PENTIUM"; break;
            case PROCESSOR_INTEL_IA64: val = "PROCESSOR_INTEL_IA64"; break;
            case PROCESSOR_AMD_X8664: val = "PROCESSOR_AMD_X8664"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_MajorVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_MajorVersion r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_MajorVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_MajorVersion *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_MajorVersion(struct ndr_print *ndr, const char *name, enum spoolss_MajorVersion r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_MAJOR_VERSION_NT4_95_98_ME: val = "SPOOLSS_MAJOR_VERSION_NT4_95_98_ME"; break;
            case SPOOLSS_MAJOR_VERSION_2000_2003_XP: val = "SPOOLSS_MAJOR_VERSION_2000_2003_XP"; break;
            case SPOOLSS_MAJOR_VERSION_2008_VISTA: val = "SPOOLSS_MAJOR_VERSION_2008_VISTA"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_MinorVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_MinorVersion r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_MinorVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_MinorVersion *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_MinorVersion(struct ndr_print *ndr, const char *name, enum spoolss_MinorVersion r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_MINOR_VERSION_0: val = "SPOOLSS_MINOR_VERSION_0"; break;
            case SPOOLSS_MINOR_VERSION_XP: val = "SPOOLSS_MINOR_VERSION_XP"; break;
            case SPOOLSS_MINOR_VERSION_2003_XP64: val = "SPOOLSS_MINOR_VERSION_2003_XP64"; break;
            case SPOOLSS_MINOR_VERSION_98: val = "SPOOLSS_MINOR_VERSION_98"; break;
            case SPOOLSS_MINOR_VERSION_ME: val = "SPOOLSS_MINOR_VERSION_ME"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterStatus(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterStatus(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterStatus(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAUSED", PRINTER_STATUS_PAUSED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_ERROR", PRINTER_STATUS_ERROR, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PENDING_DELETION", PRINTER_STATUS_PENDING_DELETION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_JAM", PRINTER_STATUS_PAPER_JAM, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_OUT", PRINTER_STATUS_PAPER_OUT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_MANUAL_FEED", PRINTER_STATUS_MANUAL_FEED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_PROBLEM", PRINTER_STATUS_PAPER_PROBLEM, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OFFLINE", PRINTER_STATUS_OFFLINE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_IO_ACTIVE", PRINTER_STATUS_IO_ACTIVE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_BUSY", PRINTER_STATUS_BUSY, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PRINTING", PRINTER_STATUS_PRINTING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OUTPUT_BIN_FULL", PRINTER_STATUS_OUTPUT_BIN_FULL, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_NOT_AVAILABLE", PRINTER_STATUS_NOT_AVAILABLE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_WAITING", PRINTER_STATUS_WAITING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PROCESSING", PRINTER_STATUS_PROCESSING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_INITIALIZING", PRINTER_STATUS_INITIALIZING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_WARMING_UP", PRINTER_STATUS_WARMING_UP, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_TONER_LOW", PRINTER_STATUS_TONER_LOW, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_NO_TONER", PRINTER_STATUS_NO_TONER, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAGE_PUNT", PRINTER_STATUS_PAGE_PUNT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_USER_INTERVENTION", PRINTER_STATUS_USER_INTERVENTION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OUT_OF_MEMORY", PRINTER_STATUS_OUT_OF_MEMORY, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_DOOR_OPEN", PRINTER_STATUS_DOOR_OPEN, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_SERVER_UNKNOWN", PRINTER_STATUS_SERVER_UNKNOWN, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_POWER_SAVE", PRINTER_STATUS_POWER_SAVE, r);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_JobStatus(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_JobStatus(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAUSED", JOB_STATUS_PAUSED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_ERROR", JOB_STATUS_ERROR, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETING", JOB_STATUS_DELETING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_SPOOLING", JOB_STATUS_SPOOLING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTING", JOB_STATUS_PRINTING, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_OFFLINE", JOB_STATUS_OFFLINE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAPEROUT", JOB_STATUS_PAPEROUT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTED", JOB_STATUS_PRINTED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETED", JOB_STATUS_DELETED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_BLOCKED_DEVQ", JOB_STATUS_BLOCKED_DEVQ, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_USER_INTERVENTION", JOB_STATUS_USER_INTERVENTION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_RESTART", JOB_STATUS_RESTART, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_COMPLETE", JOB_STATUS_COMPLETE, r);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo0(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo0 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->servername));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cjobs));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_jobs));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_bytes));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->global_counter));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->free_build));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->spooling));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_spooling));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_counter));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_error_out_of_paper));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_error_not_ready));
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->job_error));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_of_processors));
            NDR_CHECK(ndr_push_spoolss_ProcessorType(ndr, NDR_SCALARS, r->processor_type));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->high_part_total_bytes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->change_id));
            NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_error));
            NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enumerate_network_printers));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->c_setprinter));
            NDR_CHECK(ndr_push_spoolss_ProcessorArchitecture(ndr, NDR_SCALARS, r->processor_architecture));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->processor_level));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ref_ic));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved2));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved3));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printername));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printername));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->servername) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->servername));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->servername));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo0(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo0 *r)
{
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_servername;
      TALLOC_CTX *_mem_save_servername_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
                  if (_ptr_printername) {
                        NDR_PULL_ALLOC(ndr, r->printername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
                  } else {
                        r->printername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
                  if (_ptr_servername) {
                        NDR_PULL_ALLOC(ndr, r->servername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->servername, _ptr_servername));
                  } else {
                        r->servername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cjobs));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_jobs));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_bytes));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->global_counter));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->free_build));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->spooling));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_spooling));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_counter));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_error_out_of_paper));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_error_not_ready));
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->job_error));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_of_processors));
            NDR_CHECK(ndr_pull_spoolss_ProcessorType(ndr, NDR_SCALARS, &r->processor_type));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->high_part_total_bytes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->change_id));
            NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_error));
            NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enumerate_network_printers));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->c_setprinter));
            NDR_CHECK(ndr_pull_spoolss_ProcessorArchitecture(ndr, NDR_SCALARS, &r->processor_architecture));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->processor_level));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ref_ic));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
                        _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->servername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->servername));
                        _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo0(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo0 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo0");
      ndr->depth++;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "servername", r->servername);
      ndr->depth++;
      if (r->servername) {
            ndr_print_string(ndr, "servername", r->servername);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "cjobs", r->cjobs);
      ndr_print_uint32(ndr, "total_jobs", r->total_jobs);
      ndr_print_uint32(ndr, "total_bytes", r->total_bytes);
      ndr_print_spoolss_Time(ndr, "time", &r->time);
      ndr_print_uint32(ndr, "global_counter", r->global_counter);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "version", r->version);
      ndr_print_uint32(ndr, "free_build", r->free_build);
      ndr_print_uint32(ndr, "spooling", r->spooling);
      ndr_print_uint32(ndr, "max_spooling", r->max_spooling);
      ndr_print_uint32(ndr, "session_counter", r->session_counter);
      ndr_print_uint32(ndr, "num_error_out_of_paper", r->num_error_out_of_paper);
      ndr_print_uint32(ndr, "num_error_not_ready", r->num_error_not_ready);
      ndr_print_spoolss_JobStatus(ndr, "job_error", r->job_error);
      ndr_print_uint32(ndr, "number_of_processors", r->number_of_processors);
      ndr_print_spoolss_ProcessorType(ndr, "processor_type", r->processor_type);
      ndr_print_uint32(ndr, "high_part_total_bytes", r->high_part_total_bytes);
      ndr_print_uint32(ndr, "change_id", r->change_id);
      ndr_print_WERROR(ndr, "last_error", r->last_error);
      ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "enumerate_network_printers", r->enumerate_network_printers);
      ndr_print_uint32(ndr, "c_setprinter", r->c_setprinter);
      ndr_print_spoolss_ProcessorArchitecture(ndr, "processor_architecture", r->processor_architecture);
      ndr_print_uint16(ndr, "processor_level", r->processor_level);
      ndr_print_uint32(ndr, "ref_ic", r->ref_ic);
      ndr_print_uint32(ndr, "reserved2", r->reserved2);
      ndr_print_uint32(ndr, "reserved3", r->reserved3);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo0(const struct spoolss_PrinterInfo0 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo0, ic);
}

static enum ndr_err_code ndr_push_spoolss_DeviceModeFields(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DeviceModeFields(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DeviceModeFields(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_ORIENTATION", DEVMODE_ORIENTATION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PAPERSIZE", DEVMODE_PAPERSIZE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PAPERLENGTH", DEVMODE_PAPERLENGTH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PAPERWIDTH", DEVMODE_PAPERWIDTH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_SCALE", DEVMODE_SCALE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_POSITION", DEVMODE_POSITION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_NUP", DEVMODE_NUP, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_COPIES", DEVMODE_COPIES, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DEFAULTSOURCE", DEVMODE_DEFAULTSOURCE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PRINTQUALITY", DEVMODE_PRINTQUALITY, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_COLOR", DEVMODE_COLOR, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DUPLEX", DEVMODE_DUPLEX, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_YRESOLUTION", DEVMODE_YRESOLUTION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_TTOPTION", DEVMODE_TTOPTION, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_COLLATE", DEVMODE_COLLATE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_FORMNAME", DEVMODE_FORMNAME, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_LOGPIXELS", DEVMODE_LOGPIXELS, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_BITSPERPEL", DEVMODE_BITSPERPEL, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PELSWIDTH", DEVMODE_PELSWIDTH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PELSHEIGHT", DEVMODE_PELSHEIGHT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DISPLAYFLAGS", DEVMODE_DISPLAYFLAGS, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DISPLAYFREQUENCY", DEVMODE_DISPLAYFREQUENCY, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_ICMMETHOD", DEVMODE_ICMMETHOD, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_ICMINTENT", DEVMODE_ICMINTENT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_MEDIATYPE", DEVMODE_MEDIATYPE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_DITHERTYPE", DEVMODE_DITHERTYPE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PANNINGWIDTH", DEVMODE_PANNINGWIDTH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DEVMODE_PANNINGHEIGHT", DEVMODE_PANNINGHEIGHT, r);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeviceMode(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DeviceMode *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->devicename, 32, sizeof(uint16_t), CH_UTF16));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->specversion));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->driverversion));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->size));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->driverextra_data.length));
            NDR_CHECK(ndr_push_spoolss_DeviceModeFields(ndr, NDR_SCALARS, r->fields));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->orientation));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->papersize));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->paperlength));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->paperwidth));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->scale));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->copies));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->defaultsource));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->printquality));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->color));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->duplex));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->yresolution));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ttoption));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->collate));
            NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->formname, 32, sizeof(uint16_t), CH_UTF16));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->logpixels));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bitsperpel));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pelswidth));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pelsheight));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->displayflags));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->displayfrequency));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->icmmethod));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->icmintent));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->mediatype));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->dithertype));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved1));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved2));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->panningwidth));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->panningheight));
            {
                  uint32_t _flags_save_DATA_BLOB = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
                  {
                        struct ndr_push *_ndr_driverextra_data;
                        NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_driverextra_data, 0, r->driverextra_data.length));
                        NDR_CHECK(ndr_push_DATA_BLOB(_ndr_driverextra_data, NDR_SCALARS, r->driverextra_data));
                        NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_driverextra_data, 0, r->driverextra_data.length));
                  }
                  ndr->flags = _flags_save_DATA_BLOB;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DeviceMode(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DeviceMode *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->devicename, 32, sizeof(uint16_t), CH_UTF16));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->specversion));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->driverversion));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->__driverextra_length));
            NDR_CHECK(ndr_pull_spoolss_DeviceModeFields(ndr, NDR_SCALARS, &r->fields));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->orientation));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->papersize));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->paperlength));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->paperwidth));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->scale));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->copies));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->defaultsource));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->printquality));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->color));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->duplex));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->yresolution));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ttoption));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->collate));
            NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->formname, 32, sizeof(uint16_t), CH_UTF16));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->logpixels));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bitsperpel));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pelswidth));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pelsheight));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->displayflags));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->displayfrequency));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->icmmethod));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->icmintent));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->mediatype));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->dithertype));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved1));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->panningwidth));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->panningheight));
            {
                  uint32_t _flags_save_DATA_BLOB = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
                  {
                        struct ndr_pull *_ndr_driverextra_data;
                        NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_driverextra_data, 0, r->__driverextra_length));
                        NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_driverextra_data, NDR_SCALARS, &r->driverextra_data));
                        NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_driverextra_data, 0, r->__driverextra_length));
                  }
                  ndr->flags = _flags_save_DATA_BLOB;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DeviceMode(struct ndr_print *ndr, const char *name, const struct spoolss_DeviceMode *r)
{
      ndr_print_struct(ndr, name, "spoolss_DeviceMode");
      ndr->depth++;
      ndr_print_string(ndr, "devicename", r->devicename);
      ndr_print_uint16(ndr, "specversion", r->specversion);
      ndr_print_uint16(ndr, "driverversion", r->driverversion);
      ndr_print_uint16(ndr, "size", r->size);
      ndr_print_uint16(ndr, "__driverextra_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->driverextra_data.length:r->__driverextra_length);
      ndr_print_spoolss_DeviceModeFields(ndr, "fields", r->fields);
      ndr_print_uint16(ndr, "orientation", r->orientation);
      ndr_print_uint16(ndr, "papersize", r->papersize);
      ndr_print_uint16(ndr, "paperlength", r->paperlength);
      ndr_print_uint16(ndr, "paperwidth", r->paperwidth);
      ndr_print_uint16(ndr, "scale", r->scale);
      ndr_print_uint16(ndr, "copies", r->copies);
      ndr_print_uint16(ndr, "defaultsource", r->defaultsource);
      ndr_print_uint16(ndr, "printquality", r->printquality);
      ndr_print_uint16(ndr, "color", r->color);
      ndr_print_uint16(ndr, "duplex", r->duplex);
      ndr_print_uint16(ndr, "yresolution", r->yresolution);
      ndr_print_uint16(ndr, "ttoption", r->ttoption);
      ndr_print_uint16(ndr, "collate", r->collate);
      ndr_print_string(ndr, "formname", r->formname);
      ndr_print_uint16(ndr, "logpixels", r->logpixels);
      ndr_print_uint32(ndr, "bitsperpel", r->bitsperpel);
      ndr_print_uint32(ndr, "pelswidth", r->pelswidth);
      ndr_print_uint32(ndr, "pelsheight", r->pelsheight);
      ndr_print_uint32(ndr, "displayflags", r->displayflags);
      ndr_print_uint32(ndr, "displayfrequency", r->displayfrequency);
      ndr_print_uint32(ndr, "icmmethod", r->icmmethod);
      ndr_print_uint32(ndr, "icmintent", r->icmintent);
      ndr_print_uint32(ndr, "mediatype", r->mediatype);
      ndr_print_uint32(ndr, "dithertype", r->dithertype);
      ndr_print_uint32(ndr, "reserved1", r->reserved1);
      ndr_print_uint32(ndr, "reserved2", r->reserved2);
      ndr_print_uint32(ndr, "panningwidth", r->panningwidth);
      ndr_print_uint32(ndr, "panningheight", r->panningheight);
      ndr_print_DATA_BLOB(ndr, "driverextra_data", r->driverextra_data);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DeviceMode(const struct spoolss_DeviceMode *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DeviceMode, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_EnumPrinterFlags(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_DEFAULT", PRINTER_ENUM_DEFAULT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_LOCAL", PRINTER_ENUM_LOCAL, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_CONNECTIONS", PRINTER_ENUM_CONNECTIONS, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_FAVORITE", PRINTER_ENUM_FAVORITE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_NAME", PRINTER_ENUM_NAME, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_REMOTE", PRINTER_ENUM_REMOTE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_SHARED", PRINTER_ENUM_SHARED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_NETWORK", PRINTER_ENUM_NETWORK, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_EXPAND", PRINTER_ENUM_EXPAND, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_CONTAINER", PRINTER_ENUM_CONTAINER, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON1", PRINTER_ENUM_ICON1, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON2", PRINTER_ENUM_ICON2, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON3", PRINTER_ENUM_ICON3, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON4", PRINTER_ENUM_ICON4, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON5", PRINTER_ENUM_ICON5, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON6", PRINTER_ENUM_ICON6, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON7", PRINTER_ENUM_ICON7, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_ICON8", PRINTER_ENUM_ICON8, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ENUM_HIDE", PRINTER_ENUM_HIDE, r);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_EnumPrinterFlags(ndr, NDR_SCALARS, r->flags));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->description));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->comment));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->description) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->description));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->description));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->description));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->comment) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->comment));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->comment));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->comment));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo1 *r)
{
      uint32_t _ptr_description;
      TALLOC_CTX *_mem_save_description_0;
      uint32_t _ptr_name;
      TALLOC_CTX *_mem_save_name_0;
      uint32_t _ptr_comment;
      TALLOC_CTX *_mem_save_comment_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_EnumPrinterFlags(ndr, NDR_SCALARS, &r->flags));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_description));
                  if (_ptr_description) {
                        NDR_PULL_ALLOC(ndr, r->description);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->description, _ptr_description));
                  } else {
                        r->description = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
                  if (_ptr_name) {
                        NDR_PULL_ALLOC(ndr, r->name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->name, _ptr_name));
                  } else {
                        r->name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
                  if (_ptr_comment) {
                        NDR_PULL_ALLOC(ndr, r->comment);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->comment, _ptr_comment));
                  } else {
                        r->comment = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->description) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->description));
                        _mem_save_description_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->description, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->description));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_description_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->name));
                        _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->comment) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->comment));
                        _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo1");
      ndr->depth++;
      ndr_print_spoolss_EnumPrinterFlags(ndr, "flags", r->flags);
      ndr_print_ptr(ndr, "description", r->description);
      ndr->depth++;
      if (r->description) {
            ndr_print_string(ndr, "description", r->description);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "name", r->name);
      ndr->depth++;
      if (r->name) {
            ndr_print_string(ndr, "name", r->name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "comment", r->comment);
      ndr->depth++;
      if (r->comment) {
            ndr_print_string(ndr, "comment", r->comment);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo1(const struct spoolss_PrinterInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo1, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_QUEUED", PRINTER_ATTRIBUTE_QUEUED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_DIRECT", PRINTER_ATTRIBUTE_DIRECT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_DEFAULT", PRINTER_ATTRIBUTE_DEFAULT, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_SHARED", PRINTER_ATTRIBUTE_SHARED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_NETWORK", PRINTER_ATTRIBUTE_NETWORK, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_HIDDEN", PRINTER_ATTRIBUTE_HIDDEN, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_LOCAL", PRINTER_ATTRIBUTE_LOCAL, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_ENABLE_DEVQ", PRINTER_ATTRIBUTE_ENABLE_DEVQ, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS", PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST", PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_WORK_OFFLINE", PRINTER_ATTRIBUTE_WORK_OFFLINE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_ENABLE_BIDI", PRINTER_ATTRIBUTE_ENABLE_BIDI, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_RAW_ONLY", PRINTER_ATTRIBUTE_RAW_ONLY, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_PUBLISHED", PRINTER_ATTRIBUTE_PUBLISHED, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_FAX", PRINTER_ATTRIBUTE_FAX, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ATTRIBUTE_TS", PRINTER_ATTRIBUTE_TS, r);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo2 *r)
{
      uint32_t _ptr_servername;
      TALLOC_CTX *_mem_save_servername_0;
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_sharename;
      TALLOC_CTX *_mem_save_sharename_0;
      uint32_t _ptr_portname;
      TALLOC_CTX *_mem_save_portname_0;
      uint32_t _ptr_drivername;
      TALLOC_CTX *_mem_save_drivername_0;
      uint32_t _ptr_comment;
      TALLOC_CTX *_mem_save_comment_0;
      uint32_t _ptr_location;
      TALLOC_CTX *_mem_save_location_0;
      uint32_t _ptr_devmode;
      TALLOC_CTX *_mem_save_devmode_0;
      uint32_t _ptr_sepfile;
      TALLOC_CTX *_mem_save_sepfile_0;
      uint32_t _ptr_printprocessor;
      TALLOC_CTX *_mem_save_printprocessor_0;
      uint32_t _ptr_datatype;
      TALLOC_CTX *_mem_save_datatype_0;
      uint32_t _ptr_parameters;
      TALLOC_CTX *_mem_save_parameters_0;
      uint32_t _ptr_secdesc;
      TALLOC_CTX *_mem_save_secdesc_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
                  if (_ptr_servername) {
                        NDR_PULL_ALLOC(ndr, r->servername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->servername, _ptr_servername));
                  } else {
                        r->servername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
                  if (_ptr_printername) {
                        NDR_PULL_ALLOC(ndr, r->printername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
                  } else {
                        r->printername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename));
                  if (_ptr_sharename) {
                        NDR_PULL_ALLOC(ndr, r->sharename);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sharename, _ptr_sharename));
                  } else {
                        r->sharename = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_portname));
                  if (_ptr_portname) {
                        NDR_PULL_ALLOC(ndr, r->portname);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->portname, _ptr_portname));
                  } else {
                        r->portname = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_drivername));
                  if (_ptr_drivername) {
                        NDR_PULL_ALLOC(ndr, r->drivername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->drivername, _ptr_drivername));
                  } else {
                        r->drivername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
                  if (_ptr_comment) {
                        NDR_PULL_ALLOC(ndr, r->comment);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->comment, _ptr_comment));
                  } else {
                        r->comment = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_location));
                  if (_ptr_location) {
                        NDR_PULL_ALLOC(ndr, r->location);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->location, _ptr_location));
                  } else {
                        r->location = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
                  if (_ptr_devmode) {
                        NDR_PULL_ALLOC(ndr, r->devmode);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode));
                  } else {
                        r->devmode = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sepfile));
                  if (_ptr_sepfile) {
                        NDR_PULL_ALLOC(ndr, r->sepfile);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->sepfile, _ptr_sepfile));
                  } else {
                        r->sepfile = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printprocessor));
                  if (_ptr_printprocessor) {
                        NDR_PULL_ALLOC(ndr, r->printprocessor);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printprocessor, _ptr_printprocessor));
                  } else {
                        r->printprocessor = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_datatype));
                  if (_ptr_datatype) {
                        NDR_PULL_ALLOC(ndr, r->datatype);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->datatype, _ptr_datatype));
                  } else {
                        r->datatype = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
                  if (_ptr_parameters) {
                        NDR_PULL_ALLOC(ndr, r->parameters);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->parameters, _ptr_parameters));
                  } else {
                        r->parameters = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
                  if (_ptr_secdesc) {
                        NDR_PULL_ALLOC(ndr, r->secdesc);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc));
                  } else {
                        r->secdesc = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
            NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->defaultpriority));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->starttime));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->untiltime));
            NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cjobs));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->averageppm));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->servername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->servername));
                        _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
                        _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->sharename) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sharename));
                        _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->sharename, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sharename));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->portname) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->portname));
                        _mem_save_portname_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->portname, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->portname));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_portname_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->drivername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->drivername));
                        _mem_save_drivername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->drivername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->drivername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_drivername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->comment) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->comment));
                        _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->comment));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->location) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->location));
                        _mem_save_location_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->location, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->location));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_location_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode));
                        _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
                        {
                              struct ndr_pull *_ndr_devmode;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->sepfile) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->sepfile));
                        _mem_save_sepfile_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->sepfile, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->sepfile));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sepfile_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printprocessor) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printprocessor));
                        _mem_save_printprocessor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printprocessor, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printprocessor));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printprocessor_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->datatype) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->datatype));
                        _mem_save_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->datatype, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->datatype));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_datatype_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->parameters) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->parameters));
                        _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->parameters));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc));
                        _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
                        {
                              struct ndr_pull *_ndr_secdesc;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo2");
      ndr->depth++;
      ndr_print_ptr(ndr, "servername", r->servername);
      ndr->depth++;
      if (r->servername) {
            ndr_print_string(ndr, "servername", r->servername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "sharename", r->sharename);
      ndr->depth++;
      if (r->sharename) {
            ndr_print_string(ndr, "sharename", r->sharename);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "portname", r->portname);
      ndr->depth++;
      if (r->portname) {
            ndr_print_string(ndr, "portname", r->portname);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "drivername", r->drivername);
      ndr->depth++;
      if (r->drivername) {
            ndr_print_string(ndr, "drivername", r->drivername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "comment", r->comment);
      ndr->depth++;
      if (r->comment) {
            ndr_print_string(ndr, "comment", r->comment);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "location", r->location);
      ndr->depth++;
      if (r->location) {
            ndr_print_string(ndr, "location", r->location);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "devmode", r->devmode);
      ndr->depth++;
      if (r->devmode) {
            ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "sepfile", r->sepfile);
      ndr->depth++;
      if (r->sepfile) {
            ndr_print_string(ndr, "sepfile", r->sepfile);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "printprocessor", r->printprocessor);
      ndr->depth++;
      if (r->printprocessor) {
            ndr_print_string(ndr, "printprocessor", r->printprocessor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "datatype", r->datatype);
      ndr->depth++;
      if (r->datatype) {
            ndr_print_string(ndr, "datatype", r->datatype);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "parameters", r->parameters);
      ndr->depth++;
      if (r->parameters) {
            ndr_print_string(ndr, "parameters", r->parameters);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "secdesc", r->secdesc);
      ndr->depth++;
      if (r->secdesc) {
            ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc);
      }
      ndr->depth--;
      ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "defaultpriority", r->defaultpriority);
      ndr_print_uint32(ndr, "starttime", r->starttime);
      ndr_print_uint32(ndr, "untiltime", r->untiltime);
      ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "cjobs", r->cjobs);
      ndr_print_uint32(ndr, "averageppm", r->averageppm);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo2(const struct spoolss_PrinterInfo2 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo2, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc));
                        {
                              struct ndr_push *_ndr_secdesc;
                              NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc));
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo3 *r)
{
      uint32_t _ptr_secdesc;
      TALLOC_CTX *_mem_save_secdesc_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
                  if (_ptr_secdesc) {
                        NDR_PULL_ALLOC(ndr, r->secdesc);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc));
                  } else {
                        r->secdesc = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc));
                        _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
                        {
                              struct ndr_pull *_ndr_secdesc;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo3 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo3");
      ndr->depth++;
      ndr_print_ptr(ndr, "secdesc", r->secdesc);
      ndr->depth++;
      if (r->secdesc) {
            ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo3(const struct spoolss_PrinterInfo3 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo3, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo4 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->servername));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printername));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printername));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->servername) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->servername));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->servername));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->servername));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo4 *r)
{
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_servername;
      TALLOC_CTX *_mem_save_servername_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
                  if (_ptr_printername) {
                        NDR_PULL_ALLOC(ndr, r->printername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
                  } else {
                        r->printername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
                  if (_ptr_servername) {
                        NDR_PULL_ALLOC(ndr, r->servername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->servername, _ptr_servername));
                  } else {
                        r->servername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
                        _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->servername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->servername));
                        _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->servername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo4 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo4");
      ndr->depth++;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "servername", r->servername);
      ndr->depth++;
      if (r->servername) {
            ndr_print_string(ndr, "servername", r->servername);
      }
      ndr->depth--;
      ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo4(const struct spoolss_PrinterInfo4 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo4, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo5 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printername));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->portname));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->device_not_selected_timeout));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->transmission_retry_timeout));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printername));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printername));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printername));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->portname) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->portname));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->portname));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->portname));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo5 *r)
{
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_portname;
      TALLOC_CTX *_mem_save_portname_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
                  if (_ptr_printername) {
                        NDR_PULL_ALLOC(ndr, r->printername);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printername, _ptr_printername));
                  } else {
                        r->printername = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_portname));
                  if (_ptr_portname) {
                        NDR_PULL_ALLOC(ndr, r->portname);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->portname, _ptr_portname));
                  } else {
                        r->portname = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->device_not_selected_timeout));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->transmission_retry_timeout));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printername) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printername));
                        _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printername));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->portname) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->portname));
                        _mem_save_portname_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->portname, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->portname));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_portname_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo5 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo5");
      ndr->depth++;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "portname", r->portname);
      ndr->depth++;
      if (r->portname) {
            ndr_print_string(ndr, "portname", r->portname);
      }
      ndr->depth--;
      ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
      ndr_print_uint32(ndr, "device_not_selected_timeout", r->device_not_selected_timeout);
      ndr_print_uint32(ndr, "transmission_retry_timeout", r->transmission_retry_timeout);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo5(const struct spoolss_PrinterInfo5 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo5, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo6 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo6 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo6 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo6");
      ndr->depth++;
      ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo6(const struct spoolss_PrinterInfo6 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo6, ic);
}

static enum ndr_err_code ndr_push_spoolss_DsPrintAction(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DsPrintAction(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DsPrintAction(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_PUBLISH", DSPRINT_PUBLISH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_UPDATE", DSPRINT_UPDATE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_UNPUBLISH", DSPRINT_UNPUBLISH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_REPUBLISH", DSPRINT_REPUBLISH, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "DSPRINT_PENDING", DSPRINT_PENDING, r);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo7(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo7 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->guid));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_DsPrintAction(ndr, NDR_SCALARS, r->action));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->guid) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->guid));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->guid));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->guid));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo7(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo7 *r)
{
      uint32_t _ptr_guid;
      TALLOC_CTX *_mem_save_guid_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guid));
                  if (_ptr_guid) {
                        NDR_PULL_ALLOC(ndr, r->guid);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->guid, _ptr_guid));
                  } else {
                        r->guid = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_DsPrintAction(ndr, NDR_SCALARS, &r->action));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->guid) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->guid));
                        _mem_save_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->guid, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->guid));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guid_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo7(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo7 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrinterInfo7");
      ndr->depth++;
      ndr_print_ptr(ndr, "guid", r->guid);
      ndr->depth++;
      if (r->guid) {
            ndr_print_string(ndr, "guid", r->guid);
      }
      ndr->depth--;
      ndr_print_spoolss_DsPrintAction(ndr, "action", r->action);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo7(const struct spoolss_PrinterInfo7 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo7, ic);
}

static enum ndr_err_code ndr_push_spoolss_DeviceModeInfo(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DeviceModeInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->devmode));
                        {
                              struct ndr_push *_ndr_devmode;
                              NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->devmode));
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DeviceModeInfo(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DeviceModeInfo *r)
{
      uint32_t _ptr_devmode;
      TALLOC_CTX *_mem_save_devmode_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
                  if (_ptr_devmode) {
                        NDR_PULL_ALLOC(ndr, r->devmode);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode));
                  } else {
                        r->devmode = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode));
                        _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
                        {
                              struct ndr_pull *_ndr_devmode;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DeviceModeInfo(struct ndr_print *ndr, const char *name, const struct spoolss_DeviceModeInfo *r)
{
      ndr_print_struct(ndr, name, "spoolss_DeviceModeInfo");
      ndr->depth++;
      ndr_print_ptr(ndr, "devmode", r->devmode);
      ndr->depth++;
      if (r->devmode) {
            ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrinterInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 0: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo0(ndr, NDR_SCALARS, &r->info0));
                        break; }

                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        case 3: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo3(ndr, NDR_SCALARS, &r->info3));
                        break; }

                        case 4: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo4(ndr, NDR_SCALARS, &r->info4));
                        break; }

                        case 5: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo5(ndr, NDR_SCALARS, &r->info5));
                        break; }

                        case 6: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo6(ndr, NDR_SCALARS, &r->info6));
                        break; }

                        case 7: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo7(ndr, NDR_SCALARS, &r->info7));
                        break; }

                        case 8: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info8));
                        break; }

                        case 9: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info9));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 0:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo0(ndr, NDR_BUFFERS, &r->info0));
                        break;

                        case 1:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        case 3:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo3(ndr, NDR_BUFFERS, &r->info3));
                        break;

                        case 4:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo4(ndr, NDR_BUFFERS, &r->info4));
                        break;

                        case 5:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo5(ndr, NDR_BUFFERS, &r->info5));
                        break;

                        case 6:
                        break;

                        case 7:
                              NDR_CHECK(ndr_push_spoolss_PrinterInfo7(ndr, NDR_BUFFERS, &r->info7));
                        break;

                        case 8:
                              NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info8));
                        break;

                        case 9:
                              NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info9));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrinterInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 0: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo0(ndr, NDR_SCALARS, &r->info0));
                        break; }

                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        case 3: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo3(ndr, NDR_SCALARS, &r->info3));
                        break; }

                        case 4: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo4(ndr, NDR_SCALARS, &r->info4));
                        break; }

                        case 5: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo5(ndr, NDR_SCALARS, &r->info5));
                        break; }

                        case 6: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo6(ndr, NDR_SCALARS, &r->info6));
                        break; }

                        case 7: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo7(ndr, NDR_SCALARS, &r->info7));
                        break; }

                        case 8: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info8));
                        break; }

                        case 9: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS, &r->info9));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 0:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo0(ndr, NDR_BUFFERS, &r->info0));
                        break;

                        case 1:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        case 3:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo3(ndr, NDR_BUFFERS, &r->info3));
                        break;

                        case 4:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo4(ndr, NDR_BUFFERS, &r->info4));
                        break;

                        case 5:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo5(ndr, NDR_BUFFERS, &r->info5));
                        break;

                        case 6:
                        break;

                        case 7:
                              NDR_CHECK(ndr_pull_spoolss_PrinterInfo7(ndr, NDR_BUFFERS, &r->info7));
                        break;

                        case 8:
                              NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info8));
                        break;

                        case 9:
                              NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_BUFFERS, &r->info9));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrinterInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_PrinterInfo");
            switch (level) {
                  case 0:
                        ndr_print_spoolss_PrinterInfo0(ndr, "info0", &r->info0);
                  break;

                  case 1:
                        ndr_print_spoolss_PrinterInfo1(ndr, "info1", &r->info1);
                  break;

                  case 2:
                        ndr_print_spoolss_PrinterInfo2(ndr, "info2", &r->info2);
                  break;

                  case 3:
                        ndr_print_spoolss_PrinterInfo3(ndr, "info3", &r->info3);
                  break;

                  case 4:
                        ndr_print_spoolss_PrinterInfo4(ndr, "info4", &r->info4);
                  break;

                  case 5:
                        ndr_print_spoolss_PrinterInfo5(ndr, "info5", &r->info5);
                  break;

                  case 6:
                        ndr_print_spoolss_PrinterInfo6(ndr, "info6", &r->info6);
                  break;

                  case 7:
                        ndr_print_spoolss_PrinterInfo7(ndr, "info7", &r->info7);
                  break;

                  case 8:
                        ndr_print_spoolss_DeviceModeInfo(ndr, "info8", &r->info8);
                  break;

                  case 9:
                        ndr_print_spoolss_DeviceModeInfo(ndr, "info9", &r->info9);
                  break;

                  default:
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo(const union spoolss_PrinterInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      flags |= LIBNDR_FLAG_RELATIVE_REVERSE;
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo, ic);
}

static enum ndr_err_code ndr_push_spoolss_DevmodeContainer(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DevmodeContainer *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, _ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->devmode) {
                  {
                        struct ndr_push *_ndr_devmode;
                        NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 4, _ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags)));
                        NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                        NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 4, _ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags)));
                  }
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DevmodeContainer(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DevmodeContainer *r)
{
      uint32_t _ptr_devmode;
      TALLOC_CTX *_mem_save_devmode_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
            if (_ptr_devmode) {
                  NDR_PULL_ALLOC(ndr, r->devmode);
            } else {
                  r->devmode = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->devmode) {
                  _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
                  {
                        struct ndr_pull *_ndr_devmode;
                        NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 4, r->_ndr_size));
                        NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                        NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 4, r->_ndr_size));
                  }
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const char *name, const struct spoolss_DevmodeContainer *r)
{
      ndr_print_struct(ndr, name, "spoolss_DevmodeContainer");
      ndr->depth++;
      ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_spoolss_DeviceMode(r->devmode, ndr->iconv_convenience, ndr->flags):r->_ndr_size);
      ndr_print_ptr(ndr, "devmode", r->devmode);
      ndr->depth++;
      if (r->devmode) {
            ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printer_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printer_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printer_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->server_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->server_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->server_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->user_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->user_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->user_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->document_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->document_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->document_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_type) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_type));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_type));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->text_status) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->text_status));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->text_status));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo1 *r)
{
      uint32_t _ptr_printer_name;
      TALLOC_CTX *_mem_save_printer_name_0;
      uint32_t _ptr_server_name;
      TALLOC_CTX *_mem_save_server_name_0;
      uint32_t _ptr_user_name;
      TALLOC_CTX *_mem_save_user_name_0;
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_data_type;
      TALLOC_CTX *_mem_save_data_type_0;
      uint32_t _ptr_text_status;
      TALLOC_CTX *_mem_save_text_status_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
                  if (_ptr_printer_name) {
                        NDR_PULL_ALLOC(ndr, r->printer_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name));
                  } else {
                        r->printer_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
                  if (_ptr_server_name) {
                        NDR_PULL_ALLOC(ndr, r->server_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->server_name, _ptr_server_name));
                  } else {
                        r->server_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
                  if (_ptr_user_name) {
                        NDR_PULL_ALLOC(ndr, r->user_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->user_name, _ptr_user_name));
                  } else {
                        r->user_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
                  if (_ptr_document_name) {
                        NDR_PULL_ALLOC(ndr, r->document_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->document_name, _ptr_document_name));
                  } else {
                        r->document_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
                  if (_ptr_data_type) {
                        NDR_PULL_ALLOC(ndr, r->data_type);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_type, _ptr_data_type));
                  } else {
                        r->data_type = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
                  if (_ptr_text_status) {
                        NDR_PULL_ALLOC(ndr, r->text_status);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->text_status, _ptr_text_status));
                  } else {
                        r->text_status = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printer_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printer_name));
                        _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printer_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->server_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->server_name));
                        _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->user_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->user_name));
                        _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->document_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->document_name));
                        _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->document_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_type) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_type));
                        _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_type));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->text_status) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->text_status));
                        _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->text_status));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_JobInfo1");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_ptr(ndr, "printer_name", r->printer_name);
      ndr->depth++;
      if (r->printer_name) {
            ndr_print_string(ndr, "printer_name", r->printer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "server_name", r->server_name);
      ndr->depth++;
      if (r->server_name) {
            ndr_print_string(ndr, "server_name", r->server_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "user_name", r->user_name);
      ndr->depth++;
      if (r->user_name) {
            ndr_print_string(ndr, "user_name", r->user_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_type", r->data_type);
      ndr->depth++;
      if (r->data_type) {
            ndr_print_string(ndr, "data_type", r->data_type);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "text_status", r->text_status);
      ndr->depth++;
      if (r->text_status) {
            ndr_print_string(ndr, "text_status", r->text_status);
      }
      ndr->depth--;
      ndr_print_spoolss_JobStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "position", r->position);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
      ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_JobInfo1(const struct spoolss_JobInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo1, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->notify_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printer_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printer_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printer_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->server_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->server_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->server_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->user_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->user_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->user_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->document_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->document_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->document_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->notify_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->notify_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->notify_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->notify_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_type) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_type));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_type));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->print_processor));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->print_processor));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->parameters) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->parameters));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->parameters));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->devmode));
                        {
                              struct ndr_push *_ndr_devmode;
                              NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->devmode));
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->text_status) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->text_status));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->text_status));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc));
                        {
                              struct ndr_push *_ndr_secdesc;
                              NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc));
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo2 *r)
{
      uint32_t _ptr_printer_name;
      TALLOC_CTX *_mem_save_printer_name_0;
      uint32_t _ptr_server_name;
      TALLOC_CTX *_mem_save_server_name_0;
      uint32_t _ptr_user_name;
      TALLOC_CTX *_mem_save_user_name_0;
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_notify_name;
      TALLOC_CTX *_mem_save_notify_name_0;
      uint32_t _ptr_data_type;
      TALLOC_CTX *_mem_save_data_type_0;
      uint32_t _ptr_print_processor;
      TALLOC_CTX *_mem_save_print_processor_0;
      uint32_t _ptr_parameters;
      TALLOC_CTX *_mem_save_parameters_0;
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_devmode;
      TALLOC_CTX *_mem_save_devmode_0;
      uint32_t _ptr_text_status;
      TALLOC_CTX *_mem_save_text_status_0;
      uint32_t _ptr_secdesc;
      TALLOC_CTX *_mem_save_secdesc_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
                  if (_ptr_printer_name) {
                        NDR_PULL_ALLOC(ndr, r->printer_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name));
                  } else {
                        r->printer_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
                  if (_ptr_server_name) {
                        NDR_PULL_ALLOC(ndr, r->server_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->server_name, _ptr_server_name));
                  } else {
                        r->server_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
                  if (_ptr_user_name) {
                        NDR_PULL_ALLOC(ndr, r->user_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->user_name, _ptr_user_name));
                  } else {
                        r->user_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
                  if (_ptr_document_name) {
                        NDR_PULL_ALLOC(ndr, r->document_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->document_name, _ptr_document_name));
                  } else {
                        r->document_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name));
                  if (_ptr_notify_name) {
                        NDR_PULL_ALLOC(ndr, r->notify_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->notify_name, _ptr_notify_name));
                  } else {
                        r->notify_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
                  if (_ptr_data_type) {
                        NDR_PULL_ALLOC(ndr, r->data_type);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_type, _ptr_data_type));
                  } else {
                        r->data_type = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor));
                  if (_ptr_print_processor) {
                        NDR_PULL_ALLOC(ndr, r->print_processor);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->print_processor, _ptr_print_processor));
                  } else {
                        r->print_processor = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
                  if (_ptr_parameters) {
                        NDR_PULL_ALLOC(ndr, r->parameters);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->parameters, _ptr_parameters));
                  } else {
                        r->parameters = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
                  if (_ptr_devmode) {
                        NDR_PULL_ALLOC(ndr, r->devmode);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode));
                  } else {
                        r->devmode = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
                  if (_ptr_text_status) {
                        NDR_PULL_ALLOC(ndr, r->text_status);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->text_status, _ptr_text_status));
                  } else {
                        r->text_status = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
                  if (_ptr_secdesc) {
                        NDR_PULL_ALLOC(ndr, r->secdesc);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc));
                  } else {
                        r->secdesc = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printer_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printer_name));
                        _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printer_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->server_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->server_name));
                        _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->user_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->user_name));
                        _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->document_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->document_name));
                        _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->document_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->notify_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->notify_name));
                        _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->notify_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_type) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_type));
                        _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_type));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->print_processor));
                        _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->print_processor));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->parameters) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->parameters));
                        _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->parameters));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode));
                        _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
                        {
                              struct ndr_pull *_ndr_devmode;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->text_status) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->text_status));
                        _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->text_status));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc));
                        _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
                        {
                              struct ndr_pull *_ndr_secdesc;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_JobInfo2");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_ptr(ndr, "printer_name", r->printer_name);
      ndr->depth++;
      if (r->printer_name) {
            ndr_print_string(ndr, "printer_name", r->printer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "server_name", r->server_name);
      ndr->depth++;
      if (r->server_name) {
            ndr_print_string(ndr, "server_name", r->server_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "user_name", r->user_name);
      ndr->depth++;
      if (r->user_name) {
            ndr_print_string(ndr, "user_name", r->user_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "notify_name", r->notify_name);
      ndr->depth++;
      if (r->notify_name) {
            ndr_print_string(ndr, "notify_name", r->notify_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_type", r->data_type);
      ndr->depth++;
      if (r->data_type) {
            ndr_print_string(ndr, "data_type", r->data_type);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "print_processor", r->print_processor);
      ndr->depth++;
      if (r->print_processor) {
            ndr_print_string(ndr, "print_processor", r->print_processor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "parameters", r->parameters);
      ndr->depth++;
      if (r->parameters) {
            ndr_print_string(ndr, "parameters", r->parameters);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "devmode", r->devmode);
      ndr->depth++;
      if (r->devmode) {
            ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "text_status", r->text_status);
      ndr->depth++;
      if (r->text_status) {
            ndr_print_string(ndr, "text_status", r->text_status);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "secdesc", r->secdesc);
      ndr->depth++;
      if (r->secdesc) {
            ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc);
      }
      ndr->depth--;
      ndr_print_spoolss_JobStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "position", r->position);
      ndr_print_uint32(ndr, "start_time", r->start_time);
      ndr_print_uint32(ndr, "until_time", r->until_time);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "size", r->size);
      ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
      ndr_print_uint32(ndr, "time", r->time);
      ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_JobInfo2(const struct spoolss_JobInfo2 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo2, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->next_job_id));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->next_job_id));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo3 *r)
{
      ndr_print_struct(ndr, name, "spoolss_JobInfo3");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_uint32(ndr, "next_job_id", r->next_job_id);
      ndr_print_uint32(ndr, "reserved", r->reserved);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_JobInfo3(const struct spoolss_JobInfo3 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo3, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo4 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->notify_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode));
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc));
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_high));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printer_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->printer_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->printer_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->server_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->server_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->server_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->user_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->user_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->user_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->document_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->document_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->document_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->notify_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->notify_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->notify_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->notify_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_type) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_type));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_type));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->print_processor));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->print_processor));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->parameters) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->parameters));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->parameters));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->devmode));
                        {
                              struct ndr_push *_ndr_devmode;
                              NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->devmode));
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->text_status) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->text_status));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->text_status));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc));
                        {
                              struct ndr_push *_ndr_secdesc;
                              NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc));
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo4 *r)
{
      uint32_t _ptr_printer_name;
      TALLOC_CTX *_mem_save_printer_name_0;
      uint32_t _ptr_server_name;
      TALLOC_CTX *_mem_save_server_name_0;
      uint32_t _ptr_user_name;
      TALLOC_CTX *_mem_save_user_name_0;
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_notify_name;
      TALLOC_CTX *_mem_save_notify_name_0;
      uint32_t _ptr_data_type;
      TALLOC_CTX *_mem_save_data_type_0;
      uint32_t _ptr_print_processor;
      TALLOC_CTX *_mem_save_print_processor_0;
      uint32_t _ptr_parameters;
      TALLOC_CTX *_mem_save_parameters_0;
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_devmode;
      TALLOC_CTX *_mem_save_devmode_0;
      uint32_t _ptr_text_status;
      TALLOC_CTX *_mem_save_text_status_0;
      uint32_t _ptr_secdesc;
      TALLOC_CTX *_mem_save_secdesc_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
                  if (_ptr_printer_name) {
                        NDR_PULL_ALLOC(ndr, r->printer_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name));
                  } else {
                        r->printer_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
                  if (_ptr_server_name) {
                        NDR_PULL_ALLOC(ndr, r->server_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->server_name, _ptr_server_name));
                  } else {
                        r->server_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
                  if (_ptr_user_name) {
                        NDR_PULL_ALLOC(ndr, r->user_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->user_name, _ptr_user_name));
                  } else {
                        r->user_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
                  if (_ptr_document_name) {
                        NDR_PULL_ALLOC(ndr, r->document_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->document_name, _ptr_document_name));
                  } else {
                        r->document_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name));
                  if (_ptr_notify_name) {
                        NDR_PULL_ALLOC(ndr, r->notify_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->notify_name, _ptr_notify_name));
                  } else {
                        r->notify_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
                  if (_ptr_data_type) {
                        NDR_PULL_ALLOC(ndr, r->data_type);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_type, _ptr_data_type));
                  } else {
                        r->data_type = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor));
                  if (_ptr_print_processor) {
                        NDR_PULL_ALLOC(ndr, r->print_processor);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->print_processor, _ptr_print_processor));
                  } else {
                        r->print_processor = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
                  if (_ptr_parameters) {
                        NDR_PULL_ALLOC(ndr, r->parameters);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->parameters, _ptr_parameters));
                  } else {
                        r->parameters = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
                  if (_ptr_devmode) {
                        NDR_PULL_ALLOC(ndr, r->devmode);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode));
                  } else {
                        r->devmode = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
                  if (_ptr_text_status) {
                        NDR_PULL_ALLOC(ndr, r->text_status);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->text_status, _ptr_text_status));
                  } else {
                        r->text_status = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
                  if (_ptr_secdesc) {
                        NDR_PULL_ALLOC(ndr, r->secdesc);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc));
                  } else {
                        r->secdesc = NULL;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_high));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->printer_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printer_name));
                        _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printer_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->server_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->server_name));
                        _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->user_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->user_name));
                        _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->document_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->document_name));
                        _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->document_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->notify_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->notify_name));
                        _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->notify_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_type) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_type));
                        _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_type));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->print_processor));
                        _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->print_processor));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->parameters) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->parameters));
                        _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->parameters));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_DeviceMode = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->devmode) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode));
                        _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
                        {
                              struct ndr_pull *_ndr_devmode;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_DeviceMode;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->text_status) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->text_status));
                        _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->text_status));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_spoolss_security_descriptor = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
                  if (r->secdesc) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc));
                        _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
                        {
                              struct ndr_pull *_ndr_secdesc;
                              NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                              NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                              NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                        }
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_spoolss_security_descriptor;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo4 *r)
{
      ndr_print_struct(ndr, name, "spoolss_JobInfo4");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_ptr(ndr, "printer_name", r->printer_name);
      ndr->depth++;
      if (r->printer_name) {
            ndr_print_string(ndr, "printer_name", r->printer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "server_name", r->server_name);
      ndr->depth++;
      if (r->server_name) {
            ndr_print_string(ndr, "server_name", r->server_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "user_name", r->user_name);
      ndr->depth++;
      if (r->user_name) {
            ndr_print_string(ndr, "user_name", r->user_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "notify_name", r->notify_name);
      ndr->depth++;
      if (r->notify_name) {
            ndr_print_string(ndr, "notify_name", r->notify_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_type", r->data_type);
      ndr->depth++;
      if (r->data_type) {
            ndr_print_string(ndr, "data_type", r->data_type);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "print_processor", r->print_processor);
      ndr->depth++;
      if (r->print_processor) {
            ndr_print_string(ndr, "print_processor", r->print_processor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "parameters", r->parameters);
      ndr->depth++;
      if (r->parameters) {
            ndr_print_string(ndr, "parameters", r->parameters);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "devmode", r->devmode);
      ndr->depth++;
      if (r->devmode) {
            ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "text_status", r->text_status);
      ndr->depth++;
      if (r->text_status) {
            ndr_print_string(ndr, "text_status", r->text_status);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "secdesc", r->secdesc);
      ndr->depth++;
      if (r->secdesc) {
            ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc);
      }
      ndr->depth--;
      ndr_print_spoolss_JobStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "position", r->position);
      ndr_print_uint32(ndr, "start_time", r->start_time);
      ndr_print_uint32(ndr, "until_time", r->until_time);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "size", r->size);
      ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
      ndr_print_uint32(ndr, "time", r->time);
      ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
      ndr_print_uint32(ndr, "size_high", r->size_high);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_JobInfo4(const struct spoolss_JobInfo4 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo4, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_JobInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_JobInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_JobInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        case 3: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_JobInfo3(ndr, NDR_SCALARS, &r->info3));
                        break; }

                        case 4: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_JobInfo4(ndr, NDR_SCALARS, &r->info4));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_push_spoolss_JobInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_push_spoolss_JobInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        case 3:
                        break;

                        case 4:
                              NDR_CHECK(ndr_push_spoolss_JobInfo4(ndr, NDR_BUFFERS, &r->info4));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_JobInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_JobInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_JobInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        case 3: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_JobInfo3(ndr, NDR_SCALARS, &r->info3));
                        break; }

                        case 4: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_JobInfo4(ndr, NDR_SCALARS, &r->info4));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_pull_spoolss_JobInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_pull_spoolss_JobInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        case 3:
                        break;

                        case 4:
                              NDR_CHECK(ndr_pull_spoolss_JobInfo4(ndr, NDR_BUFFERS, &r->info4));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobInfo(struct ndr_print *ndr, const char *name, const union spoolss_JobInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_JobInfo");
            switch (level) {
                  case 1:
                        ndr_print_spoolss_JobInfo1(ndr, "info1", &r->info1);
                  break;

                  case 2:
                        ndr_print_spoolss_JobInfo2(ndr, "info2", &r->info2);
                  break;

                  case 3:
                        ndr_print_spoolss_JobInfo3(ndr, "info3", &r->info3);
                  break;

                  case 4:
                        ndr_print_spoolss_JobInfo4(ndr, "info4", &r->info4);
                  break;

                  default:
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ size_t ndr_size_spoolss_JobInfo(const union spoolss_JobInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      flags |= LIBNDR_FLAG_RELATIVE_REVERSE;
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo, ic);
}

static enum ndr_err_code ndr_push_spoolss_SetJobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetJobInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printer_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_type));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status));
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printer_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printer_name, ndr_charset_length(r->printer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->server_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->user_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->document_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_type) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_type, ndr_charset_length(r->data_type, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->text_status) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetJobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetJobInfo1 *r)
{
      uint32_t _ptr_printer_name;
      TALLOC_CTX *_mem_save_printer_name_0;
      uint32_t _ptr_server_name;
      TALLOC_CTX *_mem_save_server_name_0;
      uint32_t _ptr_user_name;
      TALLOC_CTX *_mem_save_user_name_0;
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_data_type;
      TALLOC_CTX *_mem_save_data_type_0;
      uint32_t _ptr_text_status;
      TALLOC_CTX *_mem_save_text_status_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
            if (_ptr_printer_name) {
                  NDR_PULL_ALLOC(ndr, r->printer_name);
            } else {
                  r->printer_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
            if (_ptr_server_name) {
                  NDR_PULL_ALLOC(ndr, r->server_name);
            } else {
                  r->server_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
            if (_ptr_user_name) {
                  NDR_PULL_ALLOC(ndr, r->user_name);
            } else {
                  r->user_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
            if (_ptr_document_name) {
                  NDR_PULL_ALLOC(ndr, r->document_name);
            } else {
                  r->document_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
            if (_ptr_data_type) {
                  NDR_PULL_ALLOC(ndr, r->data_type);
            } else {
                  r->data_type = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
            if (_ptr_text_status) {
                  NDR_PULL_ALLOC(ndr, r->text_status);
            } else {
                  r->text_status = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printer_name) {
                  _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printer_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printer_name));
                  if (ndr_get_array_length(ndr, &r->printer_name) > ndr_get_array_size(ndr, &r->printer_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printer_name), ndr_get_array_length(ndr, &r->printer_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printer_name, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
            }
            if (r->server_name) {
                  _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name));
                  if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
            }
            if (r->user_name) {
                  _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name));
                  if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
            }
            if (r->document_name) {
                  _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name));
                  if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
            }
            if (r->data_type) {
                  _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_type));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_type));
                  if (ndr_get_array_length(ndr, &r->data_type) > ndr_get_array_size(ndr, &r->data_type)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_type), ndr_get_array_length(ndr, &r->data_type));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_type, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
            }
            if (r->text_status) {
                  _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->text_status));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->text_status));
                  if (ndr_get_array_length(ndr, &r->text_status) > ndr_get_array_size(ndr, &r->text_status)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->text_status), ndr_get_array_length(ndr, &r->text_status));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetJobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetJobInfo1");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_ptr(ndr, "printer_name", r->printer_name);
      ndr->depth++;
      if (r->printer_name) {
            ndr_print_string(ndr, "printer_name", r->printer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "server_name", r->server_name);
      ndr->depth++;
      if (r->server_name) {
            ndr_print_string(ndr, "server_name", r->server_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "user_name", r->user_name);
      ndr->depth++;
      if (r->user_name) {
            ndr_print_string(ndr, "user_name", r->user_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_type", r->data_type);
      ndr->depth++;
      if (r->data_type) {
            ndr_print_string(ndr, "data_type", r->data_type);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "text_status", r->text_status);
      ndr->depth++;
      if (r->text_status) {
            ndr_print_string(ndr, "text_status", r->text_status);
      }
      ndr->depth--;
      ndr_print_spoolss_JobStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "position", r->position);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
      ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetJobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetJobInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printer_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->notify_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_type));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_devmode_ptr));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_secdesc_ptr));
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printer_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printer_name, ndr_charset_length(r->printer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->server_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->user_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->document_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->notify_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->notify_name, ndr_charset_length(r->notify_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_type) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_type, ndr_charset_length(r->data_type, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->print_processor) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->print_processor, ndr_charset_length(r->print_processor, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->parameters) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->parameters, ndr_charset_length(r->parameters, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->text_status) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetJobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetJobInfo2 *r)
{
      uint32_t _ptr_printer_name;
      TALLOC_CTX *_mem_save_printer_name_0;
      uint32_t _ptr_server_name;
      TALLOC_CTX *_mem_save_server_name_0;
      uint32_t _ptr_user_name;
      TALLOC_CTX *_mem_save_user_name_0;
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_notify_name;
      TALLOC_CTX *_mem_save_notify_name_0;
      uint32_t _ptr_data_type;
      TALLOC_CTX *_mem_save_data_type_0;
      uint32_t _ptr_print_processor;
      TALLOC_CTX *_mem_save_print_processor_0;
      uint32_t _ptr_parameters;
      TALLOC_CTX *_mem_save_parameters_0;
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_text_status;
      TALLOC_CTX *_mem_save_text_status_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
            if (_ptr_printer_name) {
                  NDR_PULL_ALLOC(ndr, r->printer_name);
            } else {
                  r->printer_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
            if (_ptr_server_name) {
                  NDR_PULL_ALLOC(ndr, r->server_name);
            } else {
                  r->server_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
            if (_ptr_user_name) {
                  NDR_PULL_ALLOC(ndr, r->user_name);
            } else {
                  r->user_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
            if (_ptr_document_name) {
                  NDR_PULL_ALLOC(ndr, r->document_name);
            } else {
                  r->document_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name));
            if (_ptr_notify_name) {
                  NDR_PULL_ALLOC(ndr, r->notify_name);
            } else {
                  r->notify_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
            if (_ptr_data_type) {
                  NDR_PULL_ALLOC(ndr, r->data_type);
            } else {
                  r->data_type = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor));
            if (_ptr_print_processor) {
                  NDR_PULL_ALLOC(ndr, r->print_processor);
            } else {
                  r->print_processor = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
            if (_ptr_parameters) {
                  NDR_PULL_ALLOC(ndr, r->parameters);
            } else {
                  r->parameters = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_devmode_ptr));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
            if (_ptr_text_status) {
                  NDR_PULL_ALLOC(ndr, r->text_status);
            } else {
                  r->text_status = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_secdesc_ptr));
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printer_name) {
                  _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printer_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printer_name));
                  if (ndr_get_array_length(ndr, &r->printer_name) > ndr_get_array_size(ndr, &r->printer_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printer_name), ndr_get_array_length(ndr, &r->printer_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printer_name, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
            }
            if (r->server_name) {
                  _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name));
                  if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
            }
            if (r->user_name) {
                  _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name));
                  if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
            }
            if (r->document_name) {
                  _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name));
                  if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
            }
            if (r->notify_name) {
                  _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->notify_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->notify_name));
                  if (ndr_get_array_length(ndr, &r->notify_name) > ndr_get_array_size(ndr, &r->notify_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->notify_name), ndr_get_array_length(ndr, &r->notify_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->notify_name, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0);
            }
            if (r->data_type) {
                  _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_type));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_type));
                  if (ndr_get_array_length(ndr, &r->data_type) > ndr_get_array_size(ndr, &r->data_type)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_type), ndr_get_array_length(ndr, &r->data_type));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_type, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
            }
            if (r->print_processor) {
                  _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->print_processor));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->print_processor));
                  if (ndr_get_array_length(ndr, &r->print_processor) > ndr_get_array_size(ndr, &r->print_processor)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->print_processor), ndr_get_array_length(ndr, &r->print_processor));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->print_processor, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0);
            }
            if (r->parameters) {
                  _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->parameters));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->parameters));
                  if (ndr_get_array_length(ndr, &r->parameters) > ndr_get_array_size(ndr, &r->parameters)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->parameters), ndr_get_array_length(ndr, &r->parameters));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->parameters, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
            }
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->text_status) {
                  _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->text_status));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->text_status));
                  if (ndr_get_array_length(ndr, &r->text_status) > ndr_get_array_size(ndr, &r->text_status)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->text_status), ndr_get_array_length(ndr, &r->text_status));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetJobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetJobInfo2");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_ptr(ndr, "printer_name", r->printer_name);
      ndr->depth++;
      if (r->printer_name) {
            ndr_print_string(ndr, "printer_name", r->printer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "server_name", r->server_name);
      ndr->depth++;
      if (r->server_name) {
            ndr_print_string(ndr, "server_name", r->server_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "user_name", r->user_name);
      ndr->depth++;
      if (r->user_name) {
            ndr_print_string(ndr, "user_name", r->user_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "notify_name", r->notify_name);
      ndr->depth++;
      if (r->notify_name) {
            ndr_print_string(ndr, "notify_name", r->notify_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_type", r->data_type);
      ndr->depth++;
      if (r->data_type) {
            ndr_print_string(ndr, "data_type", r->data_type);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "print_processor", r->print_processor);
      ndr->depth++;
      if (r->print_processor) {
            ndr_print_string(ndr, "print_processor", r->print_processor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "parameters", r->parameters);
      ndr->depth++;
      if (r->parameters) {
            ndr_print_string(ndr, "parameters", r->parameters);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_devmode_ptr", r->_devmode_ptr);
      ndr_print_ptr(ndr, "text_status", r->text_status);
      ndr->depth++;
      if (r->text_status) {
            ndr_print_string(ndr, "text_status", r->text_status);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_secdesc_ptr", r->_secdesc_ptr);
      ndr_print_spoolss_JobStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "position", r->position);
      ndr_print_uint32(ndr, "start_time", r->start_time);
      ndr_print_uint32(ndr, "until_time", r->until_time);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "size", r->size);
      ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
      ndr_print_uint32(ndr, "time", r->time);
      ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetJobInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetJobInfo4 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printer_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->notify_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_type));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_devmode_ptr));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_secdesc_ptr));
            NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_high));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printer_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printer_name, ndr_charset_length(r->printer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->server_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->user_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->document_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->notify_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->notify_name, ndr_charset_length(r->notify_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_type) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_type, ndr_charset_length(r->data_type, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->print_processor) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->print_processor, ndr_charset_length(r->print_processor, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->parameters) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->parameters, ndr_charset_length(r->parameters, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->text_status) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetJobInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetJobInfo4 *r)
{
      uint32_t _ptr_printer_name;
      TALLOC_CTX *_mem_save_printer_name_0;
      uint32_t _ptr_server_name;
      TALLOC_CTX *_mem_save_server_name_0;
      uint32_t _ptr_user_name;
      TALLOC_CTX *_mem_save_user_name_0;
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_notify_name;
      TALLOC_CTX *_mem_save_notify_name_0;
      uint32_t _ptr_data_type;
      TALLOC_CTX *_mem_save_data_type_0;
      uint32_t _ptr_print_processor;
      TALLOC_CTX *_mem_save_print_processor_0;
      uint32_t _ptr_parameters;
      TALLOC_CTX *_mem_save_parameters_0;
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_text_status;
      TALLOC_CTX *_mem_save_text_status_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name));
            if (_ptr_printer_name) {
                  NDR_PULL_ALLOC(ndr, r->printer_name);
            } else {
                  r->printer_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
            if (_ptr_server_name) {
                  NDR_PULL_ALLOC(ndr, r->server_name);
            } else {
                  r->server_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name));
            if (_ptr_user_name) {
                  NDR_PULL_ALLOC(ndr, r->user_name);
            } else {
                  r->user_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
            if (_ptr_document_name) {
                  NDR_PULL_ALLOC(ndr, r->document_name);
            } else {
                  r->document_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name));
            if (_ptr_notify_name) {
                  NDR_PULL_ALLOC(ndr, r->notify_name);
            } else {
                  r->notify_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type));
            if (_ptr_data_type) {
                  NDR_PULL_ALLOC(ndr, r->data_type);
            } else {
                  r->data_type = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor));
            if (_ptr_print_processor) {
                  NDR_PULL_ALLOC(ndr, r->print_processor);
            } else {
                  r->print_processor = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
            if (_ptr_parameters) {
                  NDR_PULL_ALLOC(ndr, r->parameters);
            } else {
                  r->parameters = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_devmode_ptr));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status));
            if (_ptr_text_status) {
                  NDR_PULL_ALLOC(ndr, r->text_status);
            } else {
                  r->text_status = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_secdesc_ptr));
            NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_high));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printer_name) {
                  _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printer_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printer_name));
                  if (ndr_get_array_length(ndr, &r->printer_name) > ndr_get_array_size(ndr, &r->printer_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printer_name), ndr_get_array_length(ndr, &r->printer_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printer_name, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0);
            }
            if (r->server_name) {
                  _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name));
                  if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
            }
            if (r->user_name) {
                  _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name));
                  if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0);
            }
            if (r->document_name) {
                  _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name));
                  if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
            }
            if (r->notify_name) {
                  _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->notify_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->notify_name));
                  if (ndr_get_array_length(ndr, &r->notify_name) > ndr_get_array_size(ndr, &r->notify_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->notify_name), ndr_get_array_length(ndr, &r->notify_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->notify_name, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0);
            }
            if (r->data_type) {
                  _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_type));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_type));
                  if (ndr_get_array_length(ndr, &r->data_type) > ndr_get_array_size(ndr, &r->data_type)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_type), ndr_get_array_length(ndr, &r->data_type));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_type, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0);
            }
            if (r->print_processor) {
                  _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->print_processor));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->print_processor));
                  if (ndr_get_array_length(ndr, &r->print_processor) > ndr_get_array_size(ndr, &r->print_processor)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->print_processor), ndr_get_array_length(ndr, &r->print_processor));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->print_processor, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0);
            }
            if (r->parameters) {
                  _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->parameters));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->parameters));
                  if (ndr_get_array_length(ndr, &r->parameters) > ndr_get_array_size(ndr, &r->parameters)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->parameters), ndr_get_array_length(ndr, &r->parameters));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->parameters, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
            }
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->text_status) {
                  _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->text_status));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->text_status));
                  if (ndr_get_array_length(ndr, &r->text_status) > ndr_get_array_size(ndr, &r->text_status)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->text_status), ndr_get_array_length(ndr, &r->text_status));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetJobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo4 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetJobInfo4");
      ndr->depth++;
      ndr_print_uint32(ndr, "job_id", r->job_id);
      ndr_print_ptr(ndr, "printer_name", r->printer_name);
      ndr->depth++;
      if (r->printer_name) {
            ndr_print_string(ndr, "printer_name", r->printer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "server_name", r->server_name);
      ndr->depth++;
      if (r->server_name) {
            ndr_print_string(ndr, "server_name", r->server_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "user_name", r->user_name);
      ndr->depth++;
      if (r->user_name) {
            ndr_print_string(ndr, "user_name", r->user_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "notify_name", r->notify_name);
      ndr->depth++;
      if (r->notify_name) {
            ndr_print_string(ndr, "notify_name", r->notify_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_type", r->data_type);
      ndr->depth++;
      if (r->data_type) {
            ndr_print_string(ndr, "data_type", r->data_type);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "print_processor", r->print_processor);
      ndr->depth++;
      if (r->print_processor) {
            ndr_print_string(ndr, "print_processor", r->print_processor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "parameters", r->parameters);
      ndr->depth++;
      if (r->parameters) {
            ndr_print_string(ndr, "parameters", r->parameters);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_devmode_ptr", r->_devmode_ptr);
      ndr_print_ptr(ndr, "text_status", r->text_status);
      ndr->depth++;
      if (r->text_status) {
            ndr_print_string(ndr, "text_status", r->text_status);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_secdesc_ptr", r->_secdesc_ptr);
      ndr_print_spoolss_JobStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "position", r->position);
      ndr_print_uint32(ndr, "start_time", r->start_time);
      ndr_print_uint32(ndr, "until_time", r->until_time);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "size", r->size);
      ndr_print_spoolss_Time(ndr, "submitted", &r->submitted);
      ndr_print_uint32(ndr, "time", r->time);
      ndr_print_uint32(ndr, "pages_printed", r->pages_printed);
      ndr_print_uint32(ndr, "size_high", r->size_high);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_SetJobInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_SetJobInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            int level = ndr_push_get_switch_value(ndr, r);
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
            switch (level) {
                  case 1: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
                  break; }

                  case 2: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
                  break; }

                  case 3: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
                  break; }

                  case 4: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4));
                  break; }

                  default: {
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case 1:
                        if (r->info1) {
                              NDR_CHECK(ndr_push_spoolss_SetJobInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              NDR_CHECK(ndr_push_spoolss_SetJobInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                        }
                  break;

                  case 3:
                        if (r->info3) {
                              NDR_CHECK(ndr_push_spoolss_JobInfo3(ndr, NDR_SCALARS, r->info3));
                        }
                  break;

                  case 4:
                        if (r->info4) {
                              NDR_CHECK(ndr_push_spoolss_SetJobInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
                        }
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_SetJobInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_SetJobInfo *r)
{
      int level;
      uint32_t _level;
      TALLOC_CTX *_mem_save_info1_0;
      TALLOC_CTX *_mem_save_info2_0;
      TALLOC_CTX *_mem_save_info3_0;
      TALLOC_CTX *_mem_save_info4_0;
      level = ndr_pull_get_switch_value(ndr, r);
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
            if (_level != level) {
                  return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
            }
            switch (level) {
                  case 1: {
                        uint32_t _ptr_info1;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
                        if (_ptr_info1) {
                              NDR_PULL_ALLOC(ndr, r->info1);
                        } else {
                              r->info1 = NULL;
                        }
                  break; }

                  case 2: {
                        uint32_t _ptr_info2;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
                        if (_ptr_info2) {
                              NDR_PULL_ALLOC(ndr, r->info2);
                        } else {
                              r->info2 = NULL;
                        }
                  break; }

                  case 3: {
                        uint32_t _ptr_info3;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
                        if (_ptr_info3) {
                              NDR_PULL_ALLOC(ndr, r->info3);
                        } else {
                              r->info3 = NULL;
                        }
                  break; }

                  case 4: {
                        uint32_t _ptr_info4;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4));
                        if (_ptr_info4) {
                              NDR_PULL_ALLOC(ndr, r->info4);
                        } else {
                              r->info4 = NULL;
                        }
                  break; }

                  default: {
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            switch (level) {
                  case 1:
                        if (r->info1) {
                              _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetJobInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetJobInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
                        }
                  break;

                  case 3:
                        if (r->info3) {
                              _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
                              NDR_CHECK(ndr_pull_spoolss_JobInfo3(ndr, NDR_SCALARS, r->info3));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
                        }
                  break;

                  case 4:
                        if (r->info4) {
                              _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetJobInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0);
                        }
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetJobInfo(struct ndr_print *ndr, const char *name, const union spoolss_SetJobInfo *r)
{
      int level;
      level = ndr_print_get_switch_value(ndr, r);
      ndr_print_union(ndr, name, level, "spoolss_SetJobInfo");
      switch (level) {
            case 1:
                  ndr_print_ptr(ndr, "info1", r->info1);
                  ndr->depth++;
                  if (r->info1) {
                        ndr_print_spoolss_SetJobInfo1(ndr, "info1", r->info1);
                  }
                  ndr->depth--;
            break;

            case 2:
                  ndr_print_ptr(ndr, "info2", r->info2);
                  ndr->depth++;
                  if (r->info2) {
                        ndr_print_spoolss_SetJobInfo2(ndr, "info2", r->info2);
                  }
                  ndr->depth--;
            break;

            case 3:
                  ndr_print_ptr(ndr, "info3", r->info3);
                  ndr->depth++;
                  if (r->info3) {
                        ndr_print_spoolss_JobInfo3(ndr, "info3", r->info3);
                  }
                  ndr->depth--;
            break;

            case 4:
                  ndr_print_ptr(ndr, "info4", r->info4);
                  ndr->depth++;
                  if (r->info4) {
                        ndr_print_spoolss_SetJobInfo4(ndr, "info4", r->info4);
                  }
                  ndr->depth--;
            break;

            default:
            break;

      }
}

static enum ndr_err_code ndr_push_spoolss_JobInfoContainer(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfoContainer *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
            NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
            NDR_CHECK(ndr_push_spoolss_SetJobInfo(ndr, NDR_SCALARS, &r->info));
      }
      if (ndr_flags & NDR_BUFFERS) {
            NDR_CHECK(ndr_push_spoolss_SetJobInfo(ndr, NDR_BUFFERS, &r->info));
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_JobInfoContainer(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfoContainer *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
            NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
            NDR_CHECK(ndr_pull_spoolss_SetJobInfo(ndr, NDR_SCALARS, &r->info));
      }
      if (ndr_flags & NDR_BUFFERS) {
            NDR_CHECK(ndr_pull_spoolss_SetJobInfo(ndr, NDR_BUFFERS, &r->info));
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobInfoContainer(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfoContainer *r)
{
      ndr_print_struct(ndr, name, "spoolss_JobInfoContainer");
      ndr->depth++;
      ndr_print_uint32(ndr, "level", r->level);
      ndr_print_set_switch_value(ndr, &r->info, r->level);
      ndr_print_spoolss_SetJobInfo(ndr, "info", &r->info);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_JobControl(struct ndr_push *ndr, int ndr_flags, enum spoolss_JobControl r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_JobControl(struct ndr_pull *ndr, int ndr_flags, enum spoolss_JobControl *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_JobControl(struct ndr_print *ndr, const char *name, enum spoolss_JobControl r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_JOB_CONTROL_PAUSE: val = "SPOOLSS_JOB_CONTROL_PAUSE"; break;
            case SPOOLSS_JOB_CONTROL_RESUME: val = "SPOOLSS_JOB_CONTROL_RESUME"; break;
            case SPOOLSS_JOB_CONTROL_CANCEL: val = "SPOOLSS_JOB_CONTROL_CANCEL"; break;
            case SPOOLSS_JOB_CONTROL_RESTART: val = "SPOOLSS_JOB_CONTROL_RESTART"; break;
            case SPOOLSS_JOB_CONTROL_DELETE: val = "SPOOLSS_JOB_CONTROL_DELETE"; break;
            case SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER: val = "SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER"; break;
            case SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED: val = "SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED"; break;
            case SPOOLSS_JOB_CONTROL_RETAIN: val = "SPOOLSS_JOB_CONTROL_RETAIN"; break;
            case SPOOLSS_JOB_CONTROL_RELEASE: val = "SPOOLSS_JOB_CONTROL_RELEASE"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_PrinterControl(struct ndr_push *ndr, int ndr_flags, enum spoolss_PrinterControl r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_PrinterControl(struct ndr_pull *ndr, int ndr_flags, enum spoolss_PrinterControl *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterControl(struct ndr_print *ndr, const char *name, enum spoolss_PrinterControl r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_PRINTER_CONTROL_UNPAUSE: val = "SPOOLSS_PRINTER_CONTROL_UNPAUSE"; break;
            case SPOOLSS_PRINTER_CONTROL_PAUSE: val = "SPOOLSS_PRINTER_CONTROL_PAUSE"; break;
            case SPOOLSS_PRINTER_CONTROL_RESUME: val = "SPOOLSS_PRINTER_CONTROL_RESUME"; break;
            case SPOOLSS_PRINTER_CONTROL_PURGE: val = "SPOOLSS_PRINTER_CONTROL_PURGE"; break;
            case SPOOLSS_PRINTER_CONTROL_SET_STATUS: val = "SPOOLSS_PRINTER_CONTROL_SET_STATUS"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo0(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo0 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->servername));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printername));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cjobs));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_jobs));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_bytes));
            NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->global_counter));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->free_build));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->spooling));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->max_spooling));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_counter));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_error_out_of_paper));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_error_not_ready));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_error));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_of_processors));
            NDR_CHECK(ndr_push_spoolss_ProcessorType(ndr, NDR_SCALARS, r->processor_type));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->high_part_total_bytes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->change_id));
            NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_error));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enumerate_network_printers));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->c_setprinter));
            NDR_CHECK(ndr_push_spoolss_ProcessorArchitecture(ndr, NDR_SCALARS, r->processor_architecture));
            NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->processor_level));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ref_ic));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved2));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved3));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->servername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->servername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->servername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->servername, ndr_charset_length(r->servername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->printername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printername, ndr_charset_length(r->printername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo0(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo0 *r)
{
      uint32_t _ptr_servername;
      TALLOC_CTX *_mem_save_servername_0;
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
            if (_ptr_servername) {
                  NDR_PULL_ALLOC(ndr, r->servername);
            } else {
                  r->servername = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
            if (_ptr_printername) {
                  NDR_PULL_ALLOC(ndr, r->printername);
            } else {
                  r->printername = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cjobs));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_jobs));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_bytes));
            NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->time));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->global_counter));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->free_build));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->spooling));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->max_spooling));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_counter));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_error_out_of_paper));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_error_not_ready));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_error));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_of_processors));
            NDR_CHECK(ndr_pull_spoolss_ProcessorType(ndr, NDR_SCALARS, &r->processor_type));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->high_part_total_bytes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->change_id));
            NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_error));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enumerate_network_printers));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->c_setprinter));
            NDR_CHECK(ndr_pull_spoolss_ProcessorArchitecture(ndr, NDR_SCALARS, &r->processor_architecture));
            NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->processor_level));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ref_ic));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved2));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->servername) {
                  _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->servername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->servername));
                  if (ndr_get_array_length(ndr, &r->servername) > ndr_get_array_size(ndr, &r->servername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->servername), ndr_get_array_length(ndr, &r->servername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->servername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->servername, ndr_get_array_length(ndr, &r->servername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
            }
            if (r->printername) {
                  _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printername));
                  if (ndr_get_array_length(ndr, &r->printername) > ndr_get_array_size(ndr, &r->printername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printername), ndr_get_array_length(ndr, &r->printername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printername, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo0(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo0 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo0");
      ndr->depth++;
      ndr_print_ptr(ndr, "servername", r->servername);
      ndr->depth++;
      if (r->servername) {
            ndr_print_string(ndr, "servername", r->servername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "cjobs", r->cjobs);
      ndr_print_uint32(ndr, "total_jobs", r->total_jobs);
      ndr_print_uint32(ndr, "total_bytes", r->total_bytes);
      ndr_print_spoolss_Time(ndr, "time", &r->time);
      ndr_print_uint32(ndr, "global_counter", r->global_counter);
      ndr_print_uint32(ndr, "total_pages", r->total_pages);
      ndr_print_uint32(ndr, "version", r->version);
      ndr_print_uint32(ndr, "free_build", r->free_build);
      ndr_print_uint32(ndr, "spooling", r->spooling);
      ndr_print_uint32(ndr, "max_spooling", r->max_spooling);
      ndr_print_uint32(ndr, "session_counter", r->session_counter);
      ndr_print_uint32(ndr, "num_error_out_of_paper", r->num_error_out_of_paper);
      ndr_print_uint32(ndr, "num_error_not_ready", r->num_error_not_ready);
      ndr_print_uint32(ndr, "job_error", r->job_error);
      ndr_print_uint32(ndr, "number_of_processors", r->number_of_processors);
      ndr_print_spoolss_ProcessorType(ndr, "processor_type", r->processor_type);
      ndr_print_uint32(ndr, "high_part_total_bytes", r->high_part_total_bytes);
      ndr_print_uint32(ndr, "change_id", r->change_id);
      ndr_print_WERROR(ndr, "last_error", r->last_error);
      ndr_print_uint32(ndr, "status", r->status);
      ndr_print_uint32(ndr, "enumerate_network_printers", r->enumerate_network_printers);
      ndr_print_uint32(ndr, "c_setprinter", r->c_setprinter);
      ndr_print_spoolss_ProcessorArchitecture(ndr, "processor_architecture", r->processor_architecture);
      ndr_print_uint16(ndr, "processor_level", r->processor_level);
      ndr_print_uint32(ndr, "ref_ic", r->ref_ic);
      ndr_print_uint32(ndr, "reserved2", r->reserved2);
      ndr_print_uint32(ndr, "reserved3", r->reserved3);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_EnumPrinterFlags(ndr, NDR_SCALARS, r->flags));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->description));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->description) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->description, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->description, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->description, ndr_charset_length(r->description, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->comment) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo1 *r)
{
      uint32_t _ptr_description;
      TALLOC_CTX *_mem_save_description_0;
      uint32_t _ptr_name;
      TALLOC_CTX *_mem_save_name_0;
      uint32_t _ptr_comment;
      TALLOC_CTX *_mem_save_comment_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_EnumPrinterFlags(ndr, NDR_SCALARS, &r->flags));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_description));
            if (_ptr_description) {
                  NDR_PULL_ALLOC(ndr, r->description);
            } else {
                  r->description = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
            if (_ptr_name) {
                  NDR_PULL_ALLOC(ndr, r->name);
            } else {
                  r->name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
            if (_ptr_comment) {
                  NDR_PULL_ALLOC(ndr, r->comment);
            } else {
                  r->comment = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->description) {
                  _mem_save_description_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->description, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->description));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->description));
                  if (ndr_get_array_length(ndr, &r->description) > ndr_get_array_size(ndr, &r->description)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->description), ndr_get_array_length(ndr, &r->description));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->description), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->description, ndr_get_array_length(ndr, &r->description), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_description_0, 0);
            }
            if (r->name) {
                  _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
                  if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
            }
            if (r->comment) {
                  _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->comment));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->comment));
                  if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo1");
      ndr->depth++;
      ndr_print_spoolss_EnumPrinterFlags(ndr, "flags", r->flags);
      ndr_print_ptr(ndr, "description", r->description);
      ndr->depth++;
      if (r->description) {
            ndr_print_string(ndr, "description", r->description);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "name", r->name);
      ndr->depth++;
      if (r->name) {
            ndr_print_string(ndr, "name", r->name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "comment", r->comment);
      ndr->depth++;
      if (r->comment) {
            ndr_print_string(ndr, "comment", r->comment);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->servername));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printername));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->sharename));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->portname));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->drivername));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->comment));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->location));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->sepfile));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printprocessor));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->datatype));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc));
            NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->defaultpriority));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->starttime));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->untiltime));
            NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->cjobs));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->averageppm));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->servername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->servername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->servername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->servername, ndr_charset_length(r->servername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->printername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printername, ndr_charset_length(r->printername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->sharename) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->sharename, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->sharename, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->sharename, ndr_charset_length(r->sharename, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->portname) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->portname, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->portname, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->portname, ndr_charset_length(r->portname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->drivername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->drivername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->drivername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->drivername, ndr_charset_length(r->drivername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->comment) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->comment, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->comment, ndr_charset_length(r->comment, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->location) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->location, ndr_charset_length(r->location, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->devmode) {
                  {
                        struct ndr_push *_ndr_devmode;
                        NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                        NDR_CHECK(ndr_push_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                        NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_devmode, 0, -1));
                  }
            }
            if (r->sepfile) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->sepfile, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->sepfile, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->sepfile, ndr_charset_length(r->sepfile, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->printprocessor) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printprocessor, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printprocessor, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printprocessor, ndr_charset_length(r->printprocessor, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->datatype) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->datatype, ndr_charset_length(r->datatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->parameters) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->parameters, ndr_charset_length(r->parameters, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->secdesc) {
                  {
                        struct ndr_push *_ndr_secdesc;
                        NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                        NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                        NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                  }
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo2 *r)
{
      uint32_t _ptr_servername;
      TALLOC_CTX *_mem_save_servername_0;
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_sharename;
      TALLOC_CTX *_mem_save_sharename_0;
      uint32_t _ptr_portname;
      TALLOC_CTX *_mem_save_portname_0;
      uint32_t _ptr_drivername;
      TALLOC_CTX *_mem_save_drivername_0;
      uint32_t _ptr_comment;
      TALLOC_CTX *_mem_save_comment_0;
      uint32_t _ptr_location;
      TALLOC_CTX *_mem_save_location_0;
      uint32_t _ptr_devmode;
      TALLOC_CTX *_mem_save_devmode_0;
      uint32_t _ptr_sepfile;
      TALLOC_CTX *_mem_save_sepfile_0;
      uint32_t _ptr_printprocessor;
      TALLOC_CTX *_mem_save_printprocessor_0;
      uint32_t _ptr_datatype;
      TALLOC_CTX *_mem_save_datatype_0;
      uint32_t _ptr_parameters;
      TALLOC_CTX *_mem_save_parameters_0;
      uint32_t _ptr_secdesc;
      TALLOC_CTX *_mem_save_secdesc_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
            if (_ptr_servername) {
                  NDR_PULL_ALLOC(ndr, r->servername);
            } else {
                  r->servername = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
            if (_ptr_printername) {
                  NDR_PULL_ALLOC(ndr, r->printername);
            } else {
                  r->printername = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sharename));
            if (_ptr_sharename) {
                  NDR_PULL_ALLOC(ndr, r->sharename);
            } else {
                  r->sharename = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_portname));
            if (_ptr_portname) {
                  NDR_PULL_ALLOC(ndr, r->portname);
            } else {
                  r->portname = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_drivername));
            if (_ptr_drivername) {
                  NDR_PULL_ALLOC(ndr, r->drivername);
            } else {
                  r->drivername = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_comment));
            if (_ptr_comment) {
                  NDR_PULL_ALLOC(ndr, r->comment);
            } else {
                  r->comment = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_location));
            if (_ptr_location) {
                  NDR_PULL_ALLOC(ndr, r->location);
            } else {
                  r->location = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode));
            if (_ptr_devmode) {
                  NDR_PULL_ALLOC(ndr, r->devmode);
            } else {
                  r->devmode = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sepfile));
            if (_ptr_sepfile) {
                  NDR_PULL_ALLOC(ndr, r->sepfile);
            } else {
                  r->sepfile = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printprocessor));
            if (_ptr_printprocessor) {
                  NDR_PULL_ALLOC(ndr, r->printprocessor);
            } else {
                  r->printprocessor = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_datatype));
            if (_ptr_datatype) {
                  NDR_PULL_ALLOC(ndr, r->datatype);
            } else {
                  r->datatype = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters));
            if (_ptr_parameters) {
                  NDR_PULL_ALLOC(ndr, r->parameters);
            } else {
                  r->parameters = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc));
            if (_ptr_secdesc) {
                  NDR_PULL_ALLOC(ndr, r->secdesc);
            } else {
                  r->secdesc = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority));
            if (r->priority > 99) {
                  return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->defaultpriority));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->starttime));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->untiltime));
            NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->cjobs));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->averageppm));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->servername) {
                  _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->servername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->servername));
                  if (ndr_get_array_length(ndr, &r->servername) > ndr_get_array_size(ndr, &r->servername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->servername), ndr_get_array_length(ndr, &r->servername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->servername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->servername, ndr_get_array_length(ndr, &r->servername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
            }
            if (r->printername) {
                  _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printername));
                  if (ndr_get_array_length(ndr, &r->printername) > ndr_get_array_size(ndr, &r->printername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printername), ndr_get_array_length(ndr, &r->printername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printername, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
            }
            if (r->sharename) {
                  _mem_save_sharename_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->sharename, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->sharename));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->sharename));
                  if (ndr_get_array_length(ndr, &r->sharename) > ndr_get_array_size(ndr, &r->sharename)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->sharename), ndr_get_array_length(ndr, &r->sharename));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->sharename), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->sharename, ndr_get_array_length(ndr, &r->sharename), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sharename_0, 0);
            }
            if (r->portname) {
                  _mem_save_portname_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->portname, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->portname));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->portname));
                  if (ndr_get_array_length(ndr, &r->portname) > ndr_get_array_size(ndr, &r->portname)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->portname), ndr_get_array_length(ndr, &r->portname));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->portname), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->portname, ndr_get_array_length(ndr, &r->portname), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_portname_0, 0);
            }
            if (r->drivername) {
                  _mem_save_drivername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->drivername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->drivername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->drivername));
                  if (ndr_get_array_length(ndr, &r->drivername) > ndr_get_array_size(ndr, &r->drivername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->drivername), ndr_get_array_length(ndr, &r->drivername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->drivername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->drivername, ndr_get_array_length(ndr, &r->drivername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_drivername_0, 0);
            }
            if (r->comment) {
                  _mem_save_comment_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->comment, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->comment));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->comment));
                  if (ndr_get_array_length(ndr, &r->comment) > ndr_get_array_size(ndr, &r->comment)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->comment), ndr_get_array_length(ndr, &r->comment));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->comment, ndr_get_array_length(ndr, &r->comment), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_comment_0, 0);
            }
            if (r->location) {
                  _mem_save_location_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->location, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->location));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->location));
                  if (ndr_get_array_length(ndr, &r->location) > ndr_get_array_size(ndr, &r->location)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->location), ndr_get_array_length(ndr, &r->location));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->location), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->location, ndr_get_array_length(ndr, &r->location), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_location_0, 0);
            }
            if (r->devmode) {
                  _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
                  {
                        struct ndr_pull *_ndr_devmode;
                        NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_devmode, 0, -1));
                        NDR_CHECK(ndr_pull_spoolss_DeviceMode(_ndr_devmode, NDR_SCALARS, r->devmode));
                        NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_devmode, 0, -1));
                  }
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
            }
            if (r->sepfile) {
                  _mem_save_sepfile_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->sepfile, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->sepfile));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->sepfile));
                  if (ndr_get_array_length(ndr, &r->sepfile) > ndr_get_array_size(ndr, &r->sepfile)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->sepfile), ndr_get_array_length(ndr, &r->sepfile));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->sepfile), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->sepfile, ndr_get_array_length(ndr, &r->sepfile), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sepfile_0, 0);
            }
            if (r->printprocessor) {
                  _mem_save_printprocessor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printprocessor, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printprocessor));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printprocessor));
                  if (ndr_get_array_length(ndr, &r->printprocessor) > ndr_get_array_size(ndr, &r->printprocessor)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printprocessor), ndr_get_array_length(ndr, &r->printprocessor));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printprocessor), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printprocessor, ndr_get_array_length(ndr, &r->printprocessor), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printprocessor_0, 0);
            }
            if (r->datatype) {
                  _mem_save_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->datatype, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->datatype));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->datatype));
                  if (ndr_get_array_length(ndr, &r->datatype) > ndr_get_array_size(ndr, &r->datatype)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->datatype), ndr_get_array_length(ndr, &r->datatype));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->datatype), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->datatype, ndr_get_array_length(ndr, &r->datatype), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_datatype_0, 0);
            }
            if (r->parameters) {
                  _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->parameters));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->parameters));
                  if (ndr_get_array_length(ndr, &r->parameters) > ndr_get_array_size(ndr, &r->parameters)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->parameters), ndr_get_array_length(ndr, &r->parameters));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->parameters, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0);
            }
            if (r->secdesc) {
                  _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0);
                  {
                        struct ndr_pull *_ndr_secdesc;
                        NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1));
                        NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc));
                        NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1));
                  }
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo2");
      ndr->depth++;
      ndr_print_ptr(ndr, "servername", r->servername);
      ndr->depth++;
      if (r->servername) {
            ndr_print_string(ndr, "servername", r->servername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "sharename", r->sharename);
      ndr->depth++;
      if (r->sharename) {
            ndr_print_string(ndr, "sharename", r->sharename);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "portname", r->portname);
      ndr->depth++;
      if (r->portname) {
            ndr_print_string(ndr, "portname", r->portname);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "drivername", r->drivername);
      ndr->depth++;
      if (r->drivername) {
            ndr_print_string(ndr, "drivername", r->drivername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "comment", r->comment);
      ndr->depth++;
      if (r->comment) {
            ndr_print_string(ndr, "comment", r->comment);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "location", r->location);
      ndr->depth++;
      if (r->location) {
            ndr_print_string(ndr, "location", r->location);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "devmode", r->devmode);
      ndr->depth++;
      if (r->devmode) {
            ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "sepfile", r->sepfile);
      ndr->depth++;
      if (r->sepfile) {
            ndr_print_string(ndr, "sepfile", r->sepfile);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "printprocessor", r->printprocessor);
      ndr->depth++;
      if (r->printprocessor) {
            ndr_print_string(ndr, "printprocessor", r->printprocessor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "datatype", r->datatype);
      ndr->depth++;
      if (r->datatype) {
            ndr_print_string(ndr, "datatype", r->datatype);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "parameters", r->parameters);
      ndr->depth++;
      if (r->parameters) {
            ndr_print_string(ndr, "parameters", r->parameters);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "secdesc", r->secdesc);
      ndr->depth++;
      if (r->secdesc) {
            ndr_print_security_descriptor(ndr, "secdesc", r->secdesc);
      }
      ndr->depth--;
      ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
      ndr_print_uint32(ndr, "priority", r->priority);
      ndr_print_uint32(ndr, "defaultpriority", r->defaultpriority);
      ndr_print_uint32(ndr, "starttime", r->starttime);
      ndr_print_uint32(ndr, "untiltime", r->untiltime);
      ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
      ndr_print_uint32(ndr, "cjobs", r->cjobs);
      ndr_print_uint32(ndr, "averageppm", r->averageppm);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sec_desc_ptr));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sec_desc_ptr));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo3 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo3");
      ndr->depth++;
      ndr_print_uint32(ndr, "sec_desc_ptr", r->sec_desc_ptr);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo4 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printername));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->servername));
            NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printername, ndr_charset_length(r->printername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->servername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->servername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->servername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->servername, ndr_charset_length(r->servername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo4 *r)
{
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_servername;
      TALLOC_CTX *_mem_save_servername_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
            if (_ptr_printername) {
                  NDR_PULL_ALLOC(ndr, r->printername);
            } else {
                  r->printername = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
            if (_ptr_servername) {
                  NDR_PULL_ALLOC(ndr, r->servername);
            } else {
                  r->servername = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printername) {
                  _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printername));
                  if (ndr_get_array_length(ndr, &r->printername) > ndr_get_array_size(ndr, &r->printername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printername), ndr_get_array_length(ndr, &r->printername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printername, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
            }
            if (r->servername) {
                  _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->servername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->servername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->servername));
                  if (ndr_get_array_length(ndr, &r->servername) > ndr_get_array_size(ndr, &r->servername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->servername), ndr_get_array_length(ndr, &r->servername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->servername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->servername, ndr_get_array_length(ndr, &r->servername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo4 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo4");
      ndr->depth++;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "servername", r->servername);
      ndr->depth++;
      if (r->servername) {
            ndr_print_string(ndr, "servername", r->servername);
      }
      ndr->depth--;
      ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo5 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->printername));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->portname));
            NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->device_not_selected_timeout));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->transmission_retry_timeout));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printername) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printername, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printername, ndr_charset_length(r->printername, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->portname) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->portname, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->portname, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->portname, ndr_charset_length(r->portname, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo5 *r)
{
      uint32_t _ptr_printername;
      TALLOC_CTX *_mem_save_printername_0;
      uint32_t _ptr_portname;
      TALLOC_CTX *_mem_save_portname_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printername));
            if (_ptr_printername) {
                  NDR_PULL_ALLOC(ndr, r->printername);
            } else {
                  r->printername = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_portname));
            if (_ptr_portname) {
                  NDR_PULL_ALLOC(ndr, r->portname);
            } else {
                  r->portname = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->device_not_selected_timeout));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->transmission_retry_timeout));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->printername) {
                  _mem_save_printername_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->printername, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->printername));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->printername));
                  if (ndr_get_array_length(ndr, &r->printername) > ndr_get_array_size(ndr, &r->printername)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printername), ndr_get_array_length(ndr, &r->printername));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printername, ndr_get_array_length(ndr, &r->printername), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printername_0, 0);
            }
            if (r->portname) {
                  _mem_save_portname_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->portname, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->portname));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->portname));
                  if (ndr_get_array_length(ndr, &r->portname) > ndr_get_array_size(ndr, &r->portname)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->portname), ndr_get_array_length(ndr, &r->portname));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->portname), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->portname, ndr_get_array_length(ndr, &r->portname), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_portname_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo5 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo5");
      ndr->depth++;
      ndr_print_ptr(ndr, "printername", r->printername);
      ndr->depth++;
      if (r->printername) {
            ndr_print_string(ndr, "printername", r->printername);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "portname", r->portname);
      ndr->depth++;
      if (r->portname) {
            ndr_print_string(ndr, "portname", r->portname);
      }
      ndr->depth--;
      ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
      ndr_print_uint32(ndr, "device_not_selected_timeout", r->device_not_selected_timeout);
      ndr_print_uint32(ndr, "transmission_retry_timeout", r->transmission_retry_timeout);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo6 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo6 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo6 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo6");
      ndr->depth++;
      ndr_print_spoolss_PrinterStatus(ndr, "status", r->status);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo7(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo7 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->guid));
            NDR_CHECK(ndr_push_spoolss_DsPrintAction(ndr, NDR_SCALARS, r->action));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->guid) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guid, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->guid, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->guid, ndr_charset_length(r->guid, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo7(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo7 *r)
{
      uint32_t _ptr_guid;
      TALLOC_CTX *_mem_save_guid_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_guid));
            if (_ptr_guid) {
                  NDR_PULL_ALLOC(ndr, r->guid);
            } else {
                  r->guid = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_DsPrintAction(ndr, NDR_SCALARS, &r->action));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->guid) {
                  _mem_save_guid_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->guid, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->guid));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->guid));
                  if (ndr_get_array_length(ndr, &r->guid) > ndr_get_array_size(ndr, &r->guid)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->guid), ndr_get_array_length(ndr, &r->guid));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->guid), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->guid, ndr_get_array_length(ndr, &r->guid), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_guid_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo7(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo7 *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo7");
      ndr->depth++;
      ndr_print_ptr(ndr, "guid", r->guid);
      ndr->depth++;
      if (r->guid) {
            ndr_print_string(ndr, "guid", r->guid);
      }
      ndr->depth--;
      ndr_print_spoolss_DsPrintAction(ndr, "action", r->action);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_SetPrinterInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            int level = ndr_push_get_switch_value(ndr, r);
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
            switch (level) {
                  case 0: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info0));
                  break; }

                  case 1: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
                  break; }

                  case 2: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
                  break; }

                  case 3: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
                  break; }

                  case 4: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4));
                  break; }

                  case 5: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info5));
                  break; }

                  case 6: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6));
                  break; }

                  case 7: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info7));
                  break; }

                  case 8: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info8));
                  break; }

                  case 9: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info9));
                  break; }

                  default: {
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case 0:
                        if (r->info0) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
                        }
                  break;

                  case 1:
                        if (r->info1) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                        }
                  break;

                  case 3:
                        if (r->info3) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo3(ndr, NDR_SCALARS, r->info3));
                        }
                  break;

                  case 4:
                        if (r->info4) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
                        }
                  break;

                  case 5:
                        if (r->info5) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5));
                        }
                  break;

                  case 6:
                        if (r->info6) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo6(ndr, NDR_SCALARS, r->info6));
                        }
                  break;

                  case 7:
                        if (r->info7) {
                              NDR_CHECK(ndr_push_spoolss_SetPrinterInfo7(ndr, NDR_SCALARS|NDR_BUFFERS, r->info7));
                        }
                  break;

                  case 8:
                        if (r->info8) {
                              NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8));
                        }
                  break;

                  case 9:
                        if (r->info9) {
                              NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info9));
                        }
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_SetPrinterInfo *r)
{
      int level;
      uint32_t _level;
      TALLOC_CTX *_mem_save_info0_0;
      TALLOC_CTX *_mem_save_info1_0;
      TALLOC_CTX *_mem_save_info2_0;
      TALLOC_CTX *_mem_save_info3_0;
      TALLOC_CTX *_mem_save_info4_0;
      TALLOC_CTX *_mem_save_info5_0;
      TALLOC_CTX *_mem_save_info6_0;
      TALLOC_CTX *_mem_save_info7_0;
      TALLOC_CTX *_mem_save_info8_0;
      TALLOC_CTX *_mem_save_info9_0;
      level = ndr_pull_get_switch_value(ndr, r);
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
            if (_level != level) {
                  return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
            }
            switch (level) {
                  case 0: {
                        uint32_t _ptr_info0;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info0));
                        if (_ptr_info0) {
                              NDR_PULL_ALLOC(ndr, r->info0);
                        } else {
                              r->info0 = NULL;
                        }
                  break; }

                  case 1: {
                        uint32_t _ptr_info1;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
                        if (_ptr_info1) {
                              NDR_PULL_ALLOC(ndr, r->info1);
                        } else {
                              r->info1 = NULL;
                        }
                  break; }

                  case 2: {
                        uint32_t _ptr_info2;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
                        if (_ptr_info2) {
                              NDR_PULL_ALLOC(ndr, r->info2);
                        } else {
                              r->info2 = NULL;
                        }
                  break; }

                  case 3: {
                        uint32_t _ptr_info3;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
                        if (_ptr_info3) {
                              NDR_PULL_ALLOC(ndr, r->info3);
                        } else {
                              r->info3 = NULL;
                        }
                  break; }

                  case 4: {
                        uint32_t _ptr_info4;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4));
                        if (_ptr_info4) {
                              NDR_PULL_ALLOC(ndr, r->info4);
                        } else {
                              r->info4 = NULL;
                        }
                  break; }

                  case 5: {
                        uint32_t _ptr_info5;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info5));
                        if (_ptr_info5) {
                              NDR_PULL_ALLOC(ndr, r->info5);
                        } else {
                              r->info5 = NULL;
                        }
                  break; }

                  case 6: {
                        uint32_t _ptr_info6;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6));
                        if (_ptr_info6) {
                              NDR_PULL_ALLOC(ndr, r->info6);
                        } else {
                              r->info6 = NULL;
                        }
                  break; }

                  case 7: {
                        uint32_t _ptr_info7;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info7));
                        if (_ptr_info7) {
                              NDR_PULL_ALLOC(ndr, r->info7);
                        } else {
                              r->info7 = NULL;
                        }
                  break; }

                  case 8: {
                        uint32_t _ptr_info8;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info8));
                        if (_ptr_info8) {
                              NDR_PULL_ALLOC(ndr, r->info8);
                        } else {
                              r->info8 = NULL;
                        }
                  break; }

                  case 9: {
                        uint32_t _ptr_info9;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info9));
                        if (_ptr_info9) {
                              NDR_PULL_ALLOC(ndr, r->info9);
                        } else {
                              r->info9 = NULL;
                        }
                  break; }

                  default: {
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            switch (level) {
                  case 0:
                        if (r->info0) {
                              _mem_save_info0_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info0, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo0(ndr, NDR_SCALARS|NDR_BUFFERS, r->info0));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info0_0, 0);
                        }
                  break;

                  case 1:
                        if (r->info1) {
                              _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
                        }
                  break;

                  case 3:
                        if (r->info3) {
                              _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo3(ndr, NDR_SCALARS, r->info3));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
                        }
                  break;

                  case 4:
                        if (r->info4) {
                              _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0);
                        }
                  break;

                  case 5:
                        if (r->info5) {
                              _mem_save_info5_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info5, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo5(ndr, NDR_SCALARS|NDR_BUFFERS, r->info5));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info5_0, 0);
                        }
                  break;

                  case 6:
                        if (r->info6) {
                              _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo6(ndr, NDR_SCALARS, r->info6));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0);
                        }
                  break;

                  case 7:
                        if (r->info7) {
                              _mem_save_info7_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info7, 0);
                              NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo7(ndr, NDR_SCALARS|NDR_BUFFERS, r->info7));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info7_0, 0);
                        }
                  break;

                  case 8:
                        if (r->info8) {
                              _mem_save_info8_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info8, 0);
                              NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info8_0, 0);
                        }
                  break;

                  case 9:
                        if (r->info9) {
                              _mem_save_info9_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info9, 0);
                              NDR_CHECK(ndr_pull_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info9));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info9_0, 0);
                        }
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_SetPrinterInfo *r)
{
      int level;
      level = ndr_print_get_switch_value(ndr, r);
      ndr_print_union(ndr, name, level, "spoolss_SetPrinterInfo");
      switch (level) {
            case 0:
                  ndr_print_ptr(ndr, "info0", r->info0);
                  ndr->depth++;
                  if (r->info0) {
                        ndr_print_spoolss_SetPrinterInfo0(ndr, "info0", r->info0);
                  }
                  ndr->depth--;
            break;

            case 1:
                  ndr_print_ptr(ndr, "info1", r->info1);
                  ndr->depth++;
                  if (r->info1) {
                        ndr_print_spoolss_SetPrinterInfo1(ndr, "info1", r->info1);
                  }
                  ndr->depth--;
            break;

            case 2:
                  ndr_print_ptr(ndr, "info2", r->info2);
                  ndr->depth++;
                  if (r->info2) {
                        ndr_print_spoolss_SetPrinterInfo2(ndr, "info2", r->info2);
                  }
                  ndr->depth--;
            break;

            case 3:
                  ndr_print_ptr(ndr, "info3", r->info3);
                  ndr->depth++;
                  if (r->info3) {
                        ndr_print_spoolss_SetPrinterInfo3(ndr, "info3", r->info3);
                  }
                  ndr->depth--;
            break;

            case 4:
                  ndr_print_ptr(ndr, "info4", r->info4);
                  ndr->depth++;
                  if (r->info4) {
                        ndr_print_spoolss_SetPrinterInfo4(ndr, "info4", r->info4);
                  }
                  ndr->depth--;
            break;

            case 5:
                  ndr_print_ptr(ndr, "info5", r->info5);
                  ndr->depth++;
                  if (r->info5) {
                        ndr_print_spoolss_SetPrinterInfo5(ndr, "info5", r->info5);
                  }
                  ndr->depth--;
            break;

            case 6:
                  ndr_print_ptr(ndr, "info6", r->info6);
                  ndr->depth++;
                  if (r->info6) {
                        ndr_print_spoolss_SetPrinterInfo6(ndr, "info6", r->info6);
                  }
                  ndr->depth--;
            break;

            case 7:
                  ndr_print_ptr(ndr, "info7", r->info7);
                  ndr->depth++;
                  if (r->info7) {
                        ndr_print_spoolss_SetPrinterInfo7(ndr, "info7", r->info7);
                  }
                  ndr->depth--;
            break;

            case 8:
                  ndr_print_ptr(ndr, "info8", r->info8);
                  ndr->depth++;
                  if (r->info8) {
                        ndr_print_spoolss_DeviceModeInfo(ndr, "info8", r->info8);
                  }
                  ndr->depth--;
            break;

            case 9:
                  ndr_print_ptr(ndr, "info9", r->info9);
                  ndr->depth++;
                  if (r->info9) {
                        ndr_print_spoolss_DeviceModeInfo(ndr, "info9", r->info9);
                  }
                  ndr->depth--;
            break;

            default:
            break;

      }
}

static enum ndr_err_code ndr_push_spoolss_SetPrinterInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfoCtr *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
            NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
            NDR_CHECK(ndr_push_spoolss_SetPrinterInfo(ndr, NDR_SCALARS, &r->info));
      }
      if (ndr_flags & NDR_BUFFERS) {
            NDR_CHECK(ndr_push_spoolss_SetPrinterInfo(ndr, NDR_BUFFERS, &r->info));
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfoCtr *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
            NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
            NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo(ndr, NDR_SCALARS, &r->info));
      }
      if (ndr_flags & NDR_BUFFERS) {
            NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo(ndr, NDR_BUFFERS, &r->info));
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_SetPrinterInfoCtr(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfoCtr *r)
{
      ndr_print_struct(ndr, name, "spoolss_SetPrinterInfoCtr");
      ndr->depth++;
      ndr_print_uint32(ndr, "level", r->level);
      ndr_print_set_switch_value(ndr, &r->info, r->level);
      ndr_print_spoolss_SetPrinterInfo(ndr, "info", &r->info);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_StringArray(struct ndr_push *ndr, int ndr_flags, const struct spoolss_StringArray *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags) - 4) / 2));
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->string));
                  ndr->flags = _flags_save_string_array;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_StringArray(struct ndr_pull *ndr, int ndr_flags, struct spoolss_StringArray *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->string));
                  ndr->flags = _flags_save_string_array;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_StringArray(struct ndr_print *ndr, const char *name, const struct spoolss_StringArray *r)
{
      ndr_print_struct(ndr, name, "spoolss_StringArray");
      ndr->depth++;
      ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(ndr_size_spoolss_StringArray(r, ndr->iconv_convenience, ndr->flags) - 4) / 2:r->_ndr_size);
      ndr_print_string_array(ndr, "string", r->string);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfo1 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfo1");
      ndr->depth++;
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverOSVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverOSVersion r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverOSVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverOSVersion *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverOSVersion(struct ndr_print *ndr, const char *name, enum spoolss_DriverOSVersion r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_DRIVER_VERSION_9X: val = "SPOOLSS_DRIVER_VERSION_9X"; break;
            case SPOOLSS_DRIVER_VERSION_NT35: val = "SPOOLSS_DRIVER_VERSION_NT35"; break;
            case SPOOLSS_DRIVER_VERSION_NT4: val = "SPOOLSS_DRIVER_VERSION_NT4"; break;
            case SPOOLSS_DRIVER_VERSION_200X: val = "SPOOLSS_DRIVER_VERSION_200X"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->architecture));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_path));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->config_file));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->architecture) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->architecture, ndr_charset_length(r->architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_path) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_path, ndr_charset_length(r->driver_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_file, ndr_charset_length(r->data_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->config_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->config_file, ndr_charset_length(r->config_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfo2 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
            if (_ptr_architecture) {
                  NDR_PULL_ALLOC(ndr, r->architecture);
            } else {
                  r->architecture = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
            if (_ptr_driver_path) {
                  NDR_PULL_ALLOC(ndr, r->driver_path);
            } else {
                  r->driver_path = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
            if (_ptr_data_file) {
                  NDR_PULL_ALLOC(ndr, r->data_file);
            } else {
                  r->data_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
            if (_ptr_config_file) {
                  NDR_PULL_ALLOC(ndr, r->config_file);
            } else {
                  r->config_file = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->architecture) {
                  _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->architecture));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->architecture));
                  if (ndr_get_array_length(ndr, &r->architecture) > ndr_get_array_size(ndr, &r->architecture)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->architecture), ndr_get_array_length(ndr, &r->architecture));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->architecture, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
            }
            if (r->driver_path) {
                  _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_path));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_path));
                  if (ndr_get_array_length(ndr, &r->driver_path) > ndr_get_array_size(ndr, &r->driver_path)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_path), ndr_get_array_length(ndr, &r->driver_path));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_path, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
            }
            if (r->data_file) {
                  _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_file));
                  if (ndr_get_array_length(ndr, &r->data_file) > ndr_get_array_size(ndr, &r->data_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_file), ndr_get_array_length(ndr, &r->data_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_file, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
            }
            if (r->config_file) {
                  _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->config_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->config_file));
                  if (ndr_get_array_length(ndr, &r->config_file) > ndr_get_array_size(ndr, &r->config_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->config_file), ndr_get_array_length(ndr, &r->config_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->config_file, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfo2");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->architecture));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_path));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->config_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->help_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->monitor_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->default_datatype));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependent_files));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->architecture) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->architecture, ndr_charset_length(r->architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_path) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_path, ndr_charset_length(r->driver_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_file, ndr_charset_length(r->data_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->config_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->config_file, ndr_charset_length(r->config_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->help_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->help_file, ndr_charset_length(r->help_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->monitor_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->monitor_name, ndr_charset_length(r->monitor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->default_datatype) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->default_datatype, ndr_charset_length(r->default_datatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->dependent_files) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfo3 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
            if (_ptr_architecture) {
                  NDR_PULL_ALLOC(ndr, r->architecture);
            } else {
                  r->architecture = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
            if (_ptr_driver_path) {
                  NDR_PULL_ALLOC(ndr, r->driver_path);
            } else {
                  r->driver_path = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
            if (_ptr_data_file) {
                  NDR_PULL_ALLOC(ndr, r->data_file);
            } else {
                  r->data_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
            if (_ptr_config_file) {
                  NDR_PULL_ALLOC(ndr, r->config_file);
            } else {
                  r->config_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
            if (_ptr_help_file) {
                  NDR_PULL_ALLOC(ndr, r->help_file);
            } else {
                  r->help_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
            if (_ptr_monitor_name) {
                  NDR_PULL_ALLOC(ndr, r->monitor_name);
            } else {
                  r->monitor_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
            if (_ptr_default_datatype) {
                  NDR_PULL_ALLOC(ndr, r->default_datatype);
            } else {
                  r->default_datatype = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_dependent_files));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
            if (_ptr_dependent_files) {
                  NDR_PULL_ALLOC(ndr, r->dependent_files);
            } else {
                  r->dependent_files = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->architecture) {
                  _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->architecture));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->architecture));
                  if (ndr_get_array_length(ndr, &r->architecture) > ndr_get_array_size(ndr, &r->architecture)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->architecture), ndr_get_array_length(ndr, &r->architecture));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->architecture, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
            }
            if (r->driver_path) {
                  _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_path));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_path));
                  if (ndr_get_array_length(ndr, &r->driver_path) > ndr_get_array_size(ndr, &r->driver_path)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_path), ndr_get_array_length(ndr, &r->driver_path));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_path, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
            }
            if (r->data_file) {
                  _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_file));
                  if (ndr_get_array_length(ndr, &r->data_file) > ndr_get_array_size(ndr, &r->data_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_file), ndr_get_array_length(ndr, &r->data_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_file, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
            }
            if (r->config_file) {
                  _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->config_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->config_file));
                  if (ndr_get_array_length(ndr, &r->config_file) > ndr_get_array_size(ndr, &r->config_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->config_file), ndr_get_array_length(ndr, &r->config_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->config_file, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
            }
            if (r->help_file) {
                  _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->help_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->help_file));
                  if (ndr_get_array_length(ndr, &r->help_file) > ndr_get_array_size(ndr, &r->help_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->help_file), ndr_get_array_length(ndr, &r->help_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->help_file, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
            }
            if (r->monitor_name) {
                  _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->monitor_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->monitor_name));
                  if (ndr_get_array_length(ndr, &r->monitor_name) > ndr_get_array_size(ndr, &r->monitor_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->monitor_name), ndr_get_array_length(ndr, &r->monitor_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->monitor_name, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
            }
            if (r->default_datatype) {
                  _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->default_datatype));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->default_datatype));
                  if (ndr_get_array_length(ndr, &r->default_datatype) > ndr_get_array_size(ndr, &r->default_datatype)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->default_datatype), ndr_get_array_length(ndr, &r->default_datatype));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->default_datatype, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
            }
            if (r->dependent_files) {
                  _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo3 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfo3");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_dependent_files", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_dependent_files);
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_spoolss_StringArray(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo4 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->architecture));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_path));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->config_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->help_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->monitor_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->default_datatype));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependent_files));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->previous_names));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->architecture) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->architecture, ndr_charset_length(r->architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_path) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_path, ndr_charset_length(r->driver_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_file, ndr_charset_length(r->data_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->config_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->config_file, ndr_charset_length(r->config_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->help_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->help_file, ndr_charset_length(r->help_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->monitor_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->monitor_name, ndr_charset_length(r->monitor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->default_datatype) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->default_datatype, ndr_charset_length(r->default_datatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->dependent_files) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
            }
            if (r->previous_names) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->previous_names));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfo4 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_previous_names;
      TALLOC_CTX *_mem_save_previous_names_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
            if (_ptr_architecture) {
                  NDR_PULL_ALLOC(ndr, r->architecture);
            } else {
                  r->architecture = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
            if (_ptr_driver_path) {
                  NDR_PULL_ALLOC(ndr, r->driver_path);
            } else {
                  r->driver_path = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
            if (_ptr_data_file) {
                  NDR_PULL_ALLOC(ndr, r->data_file);
            } else {
                  r->data_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
            if (_ptr_config_file) {
                  NDR_PULL_ALLOC(ndr, r->config_file);
            } else {
                  r->config_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
            if (_ptr_help_file) {
                  NDR_PULL_ALLOC(ndr, r->help_file);
            } else {
                  r->help_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
            if (_ptr_monitor_name) {
                  NDR_PULL_ALLOC(ndr, r->monitor_name);
            } else {
                  r->monitor_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
            if (_ptr_default_datatype) {
                  NDR_PULL_ALLOC(ndr, r->default_datatype);
            } else {
                  r->default_datatype = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_dependent_files));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
            if (_ptr_dependent_files) {
                  NDR_PULL_ALLOC(ndr, r->dependent_files);
            } else {
                  r->dependent_files = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_previous_names));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
            if (_ptr_previous_names) {
                  NDR_PULL_ALLOC(ndr, r->previous_names);
            } else {
                  r->previous_names = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->architecture) {
                  _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->architecture));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->architecture));
                  if (ndr_get_array_length(ndr, &r->architecture) > ndr_get_array_size(ndr, &r->architecture)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->architecture), ndr_get_array_length(ndr, &r->architecture));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->architecture, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
            }
            if (r->driver_path) {
                  _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_path));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_path));
                  if (ndr_get_array_length(ndr, &r->driver_path) > ndr_get_array_size(ndr, &r->driver_path)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_path), ndr_get_array_length(ndr, &r->driver_path));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_path, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
            }
            if (r->data_file) {
                  _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_file));
                  if (ndr_get_array_length(ndr, &r->data_file) > ndr_get_array_size(ndr, &r->data_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_file), ndr_get_array_length(ndr, &r->data_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_file, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
            }
            if (r->config_file) {
                  _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->config_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->config_file));
                  if (ndr_get_array_length(ndr, &r->config_file) > ndr_get_array_size(ndr, &r->config_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->config_file), ndr_get_array_length(ndr, &r->config_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->config_file, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
            }
            if (r->help_file) {
                  _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->help_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->help_file));
                  if (ndr_get_array_length(ndr, &r->help_file) > ndr_get_array_size(ndr, &r->help_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->help_file), ndr_get_array_length(ndr, &r->help_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->help_file, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
            }
            if (r->monitor_name) {
                  _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->monitor_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->monitor_name));
                  if (ndr_get_array_length(ndr, &r->monitor_name) > ndr_get_array_size(ndr, &r->monitor_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->monitor_name), ndr_get_array_length(ndr, &r->monitor_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->monitor_name, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
            }
            if (r->default_datatype) {
                  _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->default_datatype));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->default_datatype));
                  if (ndr_get_array_length(ndr, &r->default_datatype) > ndr_get_array_size(ndr, &r->default_datatype)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->default_datatype), ndr_get_array_length(ndr, &r->default_datatype));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->default_datatype, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
            }
            if (r->dependent_files) {
                  _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
            }
            if (r->previous_names) {
                  _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->previous_names));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo4 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfo4");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_dependent_files", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_dependent_files);
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_spoolss_StringArray(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_previous_names", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_previous_names);
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_spoolss_StringArray(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_DriverAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DriverAttributes(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverAttributes(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_DRIVER_PACKAGE_AWARE", PRINTER_DRIVER_PACKAGE_AWARE, r);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo6 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 8));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->architecture));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_path));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->config_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->help_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->monitor_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->default_datatype));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependent_files));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->previous_names));
            NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date));
            NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_url));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->hardware_id));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->provider));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->architecture) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->architecture, ndr_charset_length(r->architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_path) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_path, ndr_charset_length(r->driver_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_file, ndr_charset_length(r->data_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->config_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->config_file, ndr_charset_length(r->config_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->help_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->help_file, ndr_charset_length(r->help_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->monitor_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->monitor_name, ndr_charset_length(r->monitor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->default_datatype) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->default_datatype, ndr_charset_length(r->default_datatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->dependent_files) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
            }
            if (r->previous_names) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->previous_names));
            }
            if (r->manufacturer_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->manufacturer_name, ndr_charset_length(r->manufacturer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->manufacturer_url) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_url, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_url, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->manufacturer_url, ndr_charset_length(r->manufacturer_url, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->hardware_id) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->hardware_id, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->hardware_id, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->hardware_id, ndr_charset_length(r->hardware_id, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->provider) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->provider, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->provider, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->provider, ndr_charset_length(r->provider, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfo6 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_previous_names;
      TALLOC_CTX *_mem_save_previous_names_0;
      uint32_t _ptr_manufacturer_name;
      TALLOC_CTX *_mem_save_manufacturer_name_0;
      uint32_t _ptr_manufacturer_url;
      TALLOC_CTX *_mem_save_manufacturer_url_0;
      uint32_t _ptr_hardware_id;
      TALLOC_CTX *_mem_save_hardware_id_0;
      uint32_t _ptr_provider;
      TALLOC_CTX *_mem_save_provider_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 8));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
            if (_ptr_architecture) {
                  NDR_PULL_ALLOC(ndr, r->architecture);
            } else {
                  r->architecture = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
            if (_ptr_driver_path) {
                  NDR_PULL_ALLOC(ndr, r->driver_path);
            } else {
                  r->driver_path = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
            if (_ptr_data_file) {
                  NDR_PULL_ALLOC(ndr, r->data_file);
            } else {
                  r->data_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
            if (_ptr_config_file) {
                  NDR_PULL_ALLOC(ndr, r->config_file);
            } else {
                  r->config_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
            if (_ptr_help_file) {
                  NDR_PULL_ALLOC(ndr, r->help_file);
            } else {
                  r->help_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
            if (_ptr_monitor_name) {
                  NDR_PULL_ALLOC(ndr, r->monitor_name);
            } else {
                  r->monitor_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
            if (_ptr_default_datatype) {
                  NDR_PULL_ALLOC(ndr, r->default_datatype);
            } else {
                  r->default_datatype = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_dependent_files));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
            if (_ptr_dependent_files) {
                  NDR_PULL_ALLOC(ndr, r->dependent_files);
            } else {
                  r->dependent_files = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_previous_names));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
            if (_ptr_previous_names) {
                  NDR_PULL_ALLOC(ndr, r->previous_names);
            } else {
                  r->previous_names = NULL;
            }
            NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date));
            NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name));
            if (_ptr_manufacturer_name) {
                  NDR_PULL_ALLOC(ndr, r->manufacturer_name);
            } else {
                  r->manufacturer_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_url));
            if (_ptr_manufacturer_url) {
                  NDR_PULL_ALLOC(ndr, r->manufacturer_url);
            } else {
                  r->manufacturer_url = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hardware_id));
            if (_ptr_hardware_id) {
                  NDR_PULL_ALLOC(ndr, r->hardware_id);
            } else {
                  r->hardware_id = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_provider));
            if (_ptr_provider) {
                  NDR_PULL_ALLOC(ndr, r->provider);
            } else {
                  r->provider = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->architecture) {
                  _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->architecture));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->architecture));
                  if (ndr_get_array_length(ndr, &r->architecture) > ndr_get_array_size(ndr, &r->architecture)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->architecture), ndr_get_array_length(ndr, &r->architecture));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->architecture, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
            }
            if (r->driver_path) {
                  _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_path));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_path));
                  if (ndr_get_array_length(ndr, &r->driver_path) > ndr_get_array_size(ndr, &r->driver_path)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_path), ndr_get_array_length(ndr, &r->driver_path));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_path, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
            }
            if (r->data_file) {
                  _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_file));
                  if (ndr_get_array_length(ndr, &r->data_file) > ndr_get_array_size(ndr, &r->data_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_file), ndr_get_array_length(ndr, &r->data_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_file, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
            }
            if (r->config_file) {
                  _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->config_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->config_file));
                  if (ndr_get_array_length(ndr, &r->config_file) > ndr_get_array_size(ndr, &r->config_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->config_file), ndr_get_array_length(ndr, &r->config_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->config_file, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
            }
            if (r->help_file) {
                  _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->help_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->help_file));
                  if (ndr_get_array_length(ndr, &r->help_file) > ndr_get_array_size(ndr, &r->help_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->help_file), ndr_get_array_length(ndr, &r->help_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->help_file, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
            }
            if (r->monitor_name) {
                  _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->monitor_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->monitor_name));
                  if (ndr_get_array_length(ndr, &r->monitor_name) > ndr_get_array_size(ndr, &r->monitor_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->monitor_name), ndr_get_array_length(ndr, &r->monitor_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->monitor_name, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
            }
            if (r->default_datatype) {
                  _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->default_datatype));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->default_datatype));
                  if (ndr_get_array_length(ndr, &r->default_datatype) > ndr_get_array_size(ndr, &r->default_datatype)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->default_datatype), ndr_get_array_length(ndr, &r->default_datatype));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->default_datatype, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
            }
            if (r->dependent_files) {
                  _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
            }
            if (r->previous_names) {
                  _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->previous_names));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
            }
            if (r->manufacturer_name) {
                  _mem_save_manufacturer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->manufacturer_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->manufacturer_name));
                  if (ndr_get_array_length(ndr, &r->manufacturer_name) > ndr_get_array_size(ndr, &r->manufacturer_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->manufacturer_name), ndr_get_array_length(ndr, &r->manufacturer_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->manufacturer_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->manufacturer_name, ndr_get_array_length(ndr, &r->manufacturer_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0);
            }
            if (r->manufacturer_url) {
                  _mem_save_manufacturer_url_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_url, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->manufacturer_url));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->manufacturer_url));
                  if (ndr_get_array_length(ndr, &r->manufacturer_url) > ndr_get_array_size(ndr, &r->manufacturer_url)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->manufacturer_url), ndr_get_array_length(ndr, &r->manufacturer_url));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->manufacturer_url), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->manufacturer_url, ndr_get_array_length(ndr, &r->manufacturer_url), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0);
            }
            if (r->hardware_id) {
                  _mem_save_hardware_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->hardware_id, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->hardware_id));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->hardware_id));
                  if (ndr_get_array_length(ndr, &r->hardware_id) > ndr_get_array_size(ndr, &r->hardware_id)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->hardware_id), ndr_get_array_length(ndr, &r->hardware_id));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->hardware_id), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->hardware_id, ndr_get_array_length(ndr, &r->hardware_id), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0);
            }
            if (r->provider) {
                  _mem_save_provider_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->provider, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->provider));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->provider));
                  if (ndr_get_array_length(ndr, &r->provider) > ndr_get_array_size(ndr, &r->provider)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->provider), ndr_get_array_length(ndr, &r->provider));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->provider), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->provider, ndr_get_array_length(ndr, &r->provider), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo6 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfo6");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_dependent_files", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_dependent_files);
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_spoolss_StringArray(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_previous_names", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_previous_names);
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_spoolss_StringArray(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "driver_date", r->driver_date);
      ndr_print_hyper(ndr, "driver_version", r->driver_version);
      ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name);
      ndr->depth++;
      if (r->manufacturer_name) {
            ndr_print_string(ndr, "manufacturer_name", r->manufacturer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "manufacturer_url", r->manufacturer_url);
      ndr->depth++;
      if (r->manufacturer_url) {
            ndr_print_string(ndr, "manufacturer_url", r->manufacturer_url);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "hardware_id", r->hardware_id);
      ndr->depth++;
      if (r->hardware_id) {
            ndr_print_string(ndr, "hardware_id", r->hardware_id);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "provider", r->provider);
      ndr->depth++;
      if (r->provider) {
            ndr_print_string(ndr, "provider", r->provider);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfo8 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 8));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->architecture));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_path));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->config_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->help_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->monitor_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->default_datatype));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependent_files));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->previous_names));
            NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date));
            NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_url));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->hardware_id));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->provider));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->vendor_setup));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->color_profiles, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->color_profiles));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->inf_path));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->printer_driver_attributes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->core_driver_dependencies, ndr->iconv_convenience, ndr->flags) - 4) / 2)));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->core_driver_dependencies));
            NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->min_inbox_driver_ver_date));
            NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->min_inbox_driver_ver_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->architecture) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->architecture, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->architecture, ndr_charset_length(r->architecture, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->driver_path) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_path, ndr_charset_length(r->driver_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->data_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_file, ndr_charset_length(r->data_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->config_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->config_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->config_file, ndr_charset_length(r->config_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->help_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->help_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->help_file, ndr_charset_length(r->help_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->monitor_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->monitor_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->monitor_name, ndr_charset_length(r->monitor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->default_datatype) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->default_datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->default_datatype, ndr_charset_length(r->default_datatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->dependent_files) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
            }
            if (r->previous_names) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->previous_names));
            }
            if (r->manufacturer_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->manufacturer_name, ndr_charset_length(r->manufacturer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->manufacturer_url) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_url, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->manufacturer_url, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->manufacturer_url, ndr_charset_length(r->manufacturer_url, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->hardware_id) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->hardware_id, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->hardware_id, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->hardware_id, ndr_charset_length(r->hardware_id, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->provider) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->provider, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->provider, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->provider, ndr_charset_length(r->provider, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->print_processor) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->print_processor, ndr_charset_length(r->print_processor, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->vendor_setup) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->vendor_setup, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->vendor_setup, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->vendor_setup, ndr_charset_length(r->vendor_setup, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->color_profiles) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->color_profiles));
            }
            if (r->inf_path) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->inf_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->inf_path, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->inf_path, ndr_charset_length(r->inf_path, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->core_driver_dependencies) {
                  NDR_CHECK(ndr_push_spoolss_StringArray(ndr, NDR_SCALARS, r->core_driver_dependencies));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfo8 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_previous_names;
      TALLOC_CTX *_mem_save_previous_names_0;
      uint32_t _ptr_manufacturer_name;
      TALLOC_CTX *_mem_save_manufacturer_name_0;
      uint32_t _ptr_manufacturer_url;
      TALLOC_CTX *_mem_save_manufacturer_url_0;
      uint32_t _ptr_hardware_id;
      TALLOC_CTX *_mem_save_hardware_id_0;
      uint32_t _ptr_provider;
      TALLOC_CTX *_mem_save_provider_0;
      uint32_t _ptr_print_processor;
      TALLOC_CTX *_mem_save_print_processor_0;
      uint32_t _ptr_vendor_setup;
      TALLOC_CTX *_mem_save_vendor_setup_0;
      uint32_t _ptr_color_profiles;
      TALLOC_CTX *_mem_save_color_profiles_0;
      uint32_t _ptr_inf_path;
      TALLOC_CTX *_mem_save_inf_path_0;
      uint32_t _ptr_core_driver_dependencies;
      TALLOC_CTX *_mem_save_core_driver_dependencies_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 8));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
            if (_ptr_driver_name) {
                  NDR_PULL_ALLOC(ndr, r->driver_name);
            } else {
                  r->driver_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
            if (_ptr_architecture) {
                  NDR_PULL_ALLOC(ndr, r->architecture);
            } else {
                  r->architecture = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
            if (_ptr_driver_path) {
                  NDR_PULL_ALLOC(ndr, r->driver_path);
            } else {
                  r->driver_path = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
            if (_ptr_data_file) {
                  NDR_PULL_ALLOC(ndr, r->data_file);
            } else {
                  r->data_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
            if (_ptr_config_file) {
                  NDR_PULL_ALLOC(ndr, r->config_file);
            } else {
                  r->config_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
            if (_ptr_help_file) {
                  NDR_PULL_ALLOC(ndr, r->help_file);
            } else {
                  r->help_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
            if (_ptr_monitor_name) {
                  NDR_PULL_ALLOC(ndr, r->monitor_name);
            } else {
                  r->monitor_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
            if (_ptr_default_datatype) {
                  NDR_PULL_ALLOC(ndr, r->default_datatype);
            } else {
                  r->default_datatype = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_dependent_files));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
            if (_ptr_dependent_files) {
                  NDR_PULL_ALLOC(ndr, r->dependent_files);
            } else {
                  r->dependent_files = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_previous_names));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
            if (_ptr_previous_names) {
                  NDR_PULL_ALLOC(ndr, r->previous_names);
            } else {
                  r->previous_names = NULL;
            }
            NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date));
            NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name));
            if (_ptr_manufacturer_name) {
                  NDR_PULL_ALLOC(ndr, r->manufacturer_name);
            } else {
                  r->manufacturer_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_url));
            if (_ptr_manufacturer_url) {
                  NDR_PULL_ALLOC(ndr, r->manufacturer_url);
            } else {
                  r->manufacturer_url = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hardware_id));
            if (_ptr_hardware_id) {
                  NDR_PULL_ALLOC(ndr, r->hardware_id);
            } else {
                  r->hardware_id = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_provider));
            if (_ptr_provider) {
                  NDR_PULL_ALLOC(ndr, r->provider);
            } else {
                  r->provider = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor));
            if (_ptr_print_processor) {
                  NDR_PULL_ALLOC(ndr, r->print_processor);
            } else {
                  r->print_processor = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_vendor_setup));
            if (_ptr_vendor_setup) {
                  NDR_PULL_ALLOC(ndr, r->vendor_setup);
            } else {
                  r->vendor_setup = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_color_profiles));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_color_profiles));
            if (_ptr_color_profiles) {
                  NDR_PULL_ALLOC(ndr, r->color_profiles);
            } else {
                  r->color_profiles = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_inf_path));
            if (_ptr_inf_path) {
                  NDR_PULL_ALLOC(ndr, r->inf_path);
            } else {
                  r->inf_path = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->printer_driver_attributes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size_core_driver_dependencies));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_core_driver_dependencies));
            if (_ptr_core_driver_dependencies) {
                  NDR_PULL_ALLOC(ndr, r->core_driver_dependencies);
            } else {
                  r->core_driver_dependencies = NULL;
            }
            NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->min_inbox_driver_ver_date));
            NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->min_inbox_driver_ver_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->driver_name) {
                  _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name));
                  if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
            }
            if (r->architecture) {
                  _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->architecture));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->architecture));
                  if (ndr_get_array_length(ndr, &r->architecture) > ndr_get_array_size(ndr, &r->architecture)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->architecture), ndr_get_array_length(ndr, &r->architecture));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->architecture, ndr_get_array_length(ndr, &r->architecture), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
            }
            if (r->driver_path) {
                  _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_path));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_path));
                  if (ndr_get_array_length(ndr, &r->driver_path) > ndr_get_array_size(ndr, &r->driver_path)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_path), ndr_get_array_length(ndr, &r->driver_path));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_path, ndr_get_array_length(ndr, &r->driver_path), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
            }
            if (r->data_file) {
                  _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->data_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->data_file));
                  if (ndr_get_array_length(ndr, &r->data_file) > ndr_get_array_size(ndr, &r->data_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_file), ndr_get_array_length(ndr, &r->data_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_file, ndr_get_array_length(ndr, &r->data_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
            }
            if (r->config_file) {
                  _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->config_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->config_file));
                  if (ndr_get_array_length(ndr, &r->config_file) > ndr_get_array_size(ndr, &r->config_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->config_file), ndr_get_array_length(ndr, &r->config_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->config_file, ndr_get_array_length(ndr, &r->config_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
            }
            if (r->help_file) {
                  _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->help_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->help_file));
                  if (ndr_get_array_length(ndr, &r->help_file) > ndr_get_array_size(ndr, &r->help_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->help_file), ndr_get_array_length(ndr, &r->help_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->help_file, ndr_get_array_length(ndr, &r->help_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
            }
            if (r->monitor_name) {
                  _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->monitor_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->monitor_name));
                  if (ndr_get_array_length(ndr, &r->monitor_name) > ndr_get_array_size(ndr, &r->monitor_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->monitor_name), ndr_get_array_length(ndr, &r->monitor_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->monitor_name, ndr_get_array_length(ndr, &r->monitor_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
            }
            if (r->default_datatype) {
                  _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->default_datatype));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->default_datatype));
                  if (ndr_get_array_length(ndr, &r->default_datatype) > ndr_get_array_size(ndr, &r->default_datatype)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->default_datatype), ndr_get_array_length(ndr, &r->default_datatype));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->default_datatype, ndr_get_array_length(ndr, &r->default_datatype), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
            }
            if (r->dependent_files) {
                  _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->dependent_files));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
            }
            if (r->previous_names) {
                  _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->previous_names));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
            }
            if (r->manufacturer_name) {
                  _mem_save_manufacturer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->manufacturer_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->manufacturer_name));
                  if (ndr_get_array_length(ndr, &r->manufacturer_name) > ndr_get_array_size(ndr, &r->manufacturer_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->manufacturer_name), ndr_get_array_length(ndr, &r->manufacturer_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->manufacturer_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->manufacturer_name, ndr_get_array_length(ndr, &r->manufacturer_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0);
            }
            if (r->manufacturer_url) {
                  _mem_save_manufacturer_url_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_url, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->manufacturer_url));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->manufacturer_url));
                  if (ndr_get_array_length(ndr, &r->manufacturer_url) > ndr_get_array_size(ndr, &r->manufacturer_url)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->manufacturer_url), ndr_get_array_length(ndr, &r->manufacturer_url));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->manufacturer_url), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->manufacturer_url, ndr_get_array_length(ndr, &r->manufacturer_url), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0);
            }
            if (r->hardware_id) {
                  _mem_save_hardware_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->hardware_id, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->hardware_id));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->hardware_id));
                  if (ndr_get_array_length(ndr, &r->hardware_id) > ndr_get_array_size(ndr, &r->hardware_id)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->hardware_id), ndr_get_array_length(ndr, &r->hardware_id));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->hardware_id), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->hardware_id, ndr_get_array_length(ndr, &r->hardware_id), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0);
            }
            if (r->provider) {
                  _mem_save_provider_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->provider, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->provider));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->provider));
                  if (ndr_get_array_length(ndr, &r->provider) > ndr_get_array_size(ndr, &r->provider)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->provider), ndr_get_array_length(ndr, &r->provider));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->provider), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->provider, ndr_get_array_length(ndr, &r->provider), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0);
            }
            if (r->print_processor) {
                  _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->print_processor));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->print_processor));
                  if (ndr_get_array_length(ndr, &r->print_processor) > ndr_get_array_size(ndr, &r->print_processor)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->print_processor), ndr_get_array_length(ndr, &r->print_processor));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->print_processor, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0);
            }
            if (r->vendor_setup) {
                  _mem_save_vendor_setup_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->vendor_setup, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->vendor_setup));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->vendor_setup));
                  if (ndr_get_array_length(ndr, &r->vendor_setup) > ndr_get_array_size(ndr, &r->vendor_setup)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->vendor_setup), ndr_get_array_length(ndr, &r->vendor_setup));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->vendor_setup), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->vendor_setup, ndr_get_array_length(ndr, &r->vendor_setup), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_vendor_setup_0, 0);
            }
            if (r->color_profiles) {
                  _mem_save_color_profiles_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->color_profiles, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->color_profiles));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_color_profiles_0, 0);
            }
            if (r->inf_path) {
                  _mem_save_inf_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->inf_path, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->inf_path));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->inf_path));
                  if (ndr_get_array_length(ndr, &r->inf_path) > ndr_get_array_size(ndr, &r->inf_path)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->inf_path), ndr_get_array_length(ndr, &r->inf_path));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->inf_path), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->inf_path, ndr_get_array_length(ndr, &r->inf_path), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_inf_path_0, 0);
            }
            if (r->core_driver_dependencies) {
                  _mem_save_core_driver_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->core_driver_dependencies, 0);
                  NDR_CHECK(ndr_pull_spoolss_StringArray(ndr, NDR_SCALARS, r->core_driver_dependencies));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_core_driver_dependencies_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo8 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfo8");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_dependent_files", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->dependent_files, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_dependent_files);
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_spoolss_StringArray(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_previous_names", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_previous_names);
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_spoolss_StringArray(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "driver_date", r->driver_date);
      ndr_print_hyper(ndr, "driver_version", r->driver_version);
      ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name);
      ndr->depth++;
      if (r->manufacturer_name) {
            ndr_print_string(ndr, "manufacturer_name", r->manufacturer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "manufacturer_url", r->manufacturer_url);
      ndr->depth++;
      if (r->manufacturer_url) {
            ndr_print_string(ndr, "manufacturer_url", r->manufacturer_url);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "hardware_id", r->hardware_id);
      ndr->depth++;
      if (r->hardware_id) {
            ndr_print_string(ndr, "hardware_id", r->hardware_id);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "provider", r->provider);
      ndr->depth++;
      if (r->provider) {
            ndr_print_string(ndr, "provider", r->provider);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "print_processor", r->print_processor);
      ndr->depth++;
      if (r->print_processor) {
            ndr_print_string(ndr, "print_processor", r->print_processor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "vendor_setup", r->vendor_setup);
      ndr->depth++;
      if (r->vendor_setup) {
            ndr_print_string(ndr, "vendor_setup", r->vendor_setup);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "_ndr_size_color_profiles", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->color_profiles, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_color_profiles);
      ndr_print_ptr(ndr, "color_profiles", r->color_profiles);
      ndr->depth++;
      if (r->color_profiles) {
            ndr_print_spoolss_StringArray(ndr, "color_profiles", r->color_profiles);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "inf_path", r->inf_path);
      ndr->depth++;
      if (r->inf_path) {
            ndr_print_string(ndr, "inf_path", r->inf_path);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "printer_driver_attributes", r->printer_driver_attributes);
      ndr_print_uint32(ndr, "_ndr_size_core_driver_dependencies", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?((ndr_size_spoolss_StringArray(r->core_driver_dependencies, ndr->iconv_convenience, ndr->flags) - 4) / 2):r->_ndr_size_core_driver_dependencies);
      ndr_print_ptr(ndr, "core_driver_dependencies", r->core_driver_dependencies);
      ndr->depth++;
      if (r->core_driver_dependencies) {
            ndr_print_spoolss_StringArray(ndr, "core_driver_dependencies", r->core_driver_dependencies);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "min_inbox_driver_ver_date", r->min_inbox_driver_ver_date);
      ndr_print_hyper(ndr, "min_inbox_driver_ver_version", r->min_inbox_driver_ver_version);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_AddDriverInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            int level = ndr_push_get_switch_value(ndr, r);
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
            switch (level) {
                  case 1: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
                  break; }

                  case 2: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
                  break; }

                  case 3: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3));
                  break; }

                  case 4: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4));
                  break; }

                  case 6: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info6));
                  break; }

                  case 8: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info8));
                  break; }

                  default:
                        return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case 1:
                        if (r->info1) {
                              NDR_CHECK(ndr_push_spoolss_AddDriverInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              NDR_CHECK(ndr_push_spoolss_AddDriverInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                        }
                  break;

                  case 3:
                        if (r->info3) {
                              NDR_CHECK(ndr_push_spoolss_AddDriverInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3));
                        }
                  break;

                  case 4:
                        if (r->info4) {
                              NDR_CHECK(ndr_push_spoolss_AddDriverInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
                        }
                  break;

                  case 6:
                        if (r->info6) {
                              NDR_CHECK(ndr_push_spoolss_AddDriverInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6));
                        }
                  break;

                  case 8:
                        if (r->info8) {
                              NDR_CHECK(ndr_push_spoolss_AddDriverInfo8(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8));
                        }
                  break;

                  default:
                        return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_AddDriverInfo *r)
{
      int level;
      uint32_t _level;
      TALLOC_CTX *_mem_save_info1_0;
      TALLOC_CTX *_mem_save_info2_0;
      TALLOC_CTX *_mem_save_info3_0;
      TALLOC_CTX *_mem_save_info4_0;
      TALLOC_CTX *_mem_save_info6_0;
      TALLOC_CTX *_mem_save_info8_0;
      level = ndr_pull_get_switch_value(ndr, r);
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
            if (_level != level) {
                  return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
            }
            switch (level) {
                  case 1: {
                        uint32_t _ptr_info1;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
                        if (_ptr_info1) {
                              NDR_PULL_ALLOC(ndr, r->info1);
                        } else {
                              r->info1 = NULL;
                        }
                  break; }

                  case 2: {
                        uint32_t _ptr_info2;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
                        if (_ptr_info2) {
                              NDR_PULL_ALLOC(ndr, r->info2);
                        } else {
                              r->info2 = NULL;
                        }
                  break; }

                  case 3: {
                        uint32_t _ptr_info3;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3));
                        if (_ptr_info3) {
                              NDR_PULL_ALLOC(ndr, r->info3);
                        } else {
                              r->info3 = NULL;
                        }
                  break; }

                  case 4: {
                        uint32_t _ptr_info4;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4));
                        if (_ptr_info4) {
                              NDR_PULL_ALLOC(ndr, r->info4);
                        } else {
                              r->info4 = NULL;
                        }
                  break; }

                  case 6: {
                        uint32_t _ptr_info6;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info6));
                        if (_ptr_info6) {
                              NDR_PULL_ALLOC(ndr, r->info6);
                        } else {
                              r->info6 = NULL;
                        }
                  break; }

                  case 8: {
                        uint32_t _ptr_info8;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info8));
                        if (_ptr_info8) {
                              NDR_PULL_ALLOC(ndr, r->info8);
                        } else {
                              r->info8 = NULL;
                        }
                  break; }

                  default:
                        return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            switch (level) {
                  case 1:
                        if (r->info1) {
                              _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddDriverInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddDriverInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
                        }
                  break;

                  case 3:
                        if (r->info3) {
                              _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddDriverInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0);
                        }
                  break;

                  case 4:
                        if (r->info4) {
                              _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddDriverInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0);
                        }
                  break;

                  case 6:
                        if (r->info6) {
                              _mem_save_info6_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info6, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddDriverInfo6(ndr, NDR_SCALARS|NDR_BUFFERS, r->info6));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info6_0, 0);
                        }
                  break;

                  case 8:
                        if (r->info8) {
                              _mem_save_info8_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info8, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddDriverInfo8(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info8_0, 0);
                        }
                  break;

                  default:
                        return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfo(struct ndr_print *ndr, const char *name, const union spoolss_AddDriverInfo *r)
{
      int level;
      level = ndr_print_get_switch_value(ndr, r);
      ndr_print_union(ndr, name, level, "spoolss_AddDriverInfo");
      switch (level) {
            case 1:
                  ndr_print_ptr(ndr, "info1", r->info1);
                  ndr->depth++;
                  if (r->info1) {
                        ndr_print_spoolss_AddDriverInfo1(ndr, "info1", r->info1);
                  }
                  ndr->depth--;
            break;

            case 2:
                  ndr_print_ptr(ndr, "info2", r->info2);
                  ndr->depth++;
                  if (r->info2) {
                        ndr_print_spoolss_AddDriverInfo2(ndr, "info2", r->info2);
                  }
                  ndr->depth--;
            break;

            case 3:
                  ndr_print_ptr(ndr, "info3", r->info3);
                  ndr->depth++;
                  if (r->info3) {
                        ndr_print_spoolss_AddDriverInfo3(ndr, "info3", r->info3);
                  }
                  ndr->depth--;
            break;

            case 4:
                  ndr_print_ptr(ndr, "info4", r->info4);
                  ndr->depth++;
                  if (r->info4) {
                        ndr_print_spoolss_AddDriverInfo4(ndr, "info4", r->info4);
                  }
                  ndr->depth--;
            break;

            case 6:
                  ndr_print_ptr(ndr, "info6", r->info6);
                  ndr->depth++;
                  if (r->info6) {
                        ndr_print_spoolss_AddDriverInfo6(ndr, "info6", r->info6);
                  }
                  ndr->depth--;
            break;

            case 8:
                  ndr_print_ptr(ndr, "info8", r->info8);
                  ndr->depth++;
                  if (r->info8) {
                        ndr_print_spoolss_AddDriverInfo8(ndr, "info8", r->info8);
                  }
                  ndr->depth--;
            break;

            default:
                  ndr_print_bad_level(ndr, name, level);
      }
}

static enum ndr_err_code ndr_push_spoolss_AddDriverInfoCtr(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddDriverInfoCtr *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
            NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
            NDR_CHECK(ndr_push_spoolss_AddDriverInfo(ndr, NDR_SCALARS, &r->info));
      }
      if (ndr_flags & NDR_BUFFERS) {
            NDR_CHECK(ndr_push_spoolss_AddDriverInfo(ndr, NDR_BUFFERS, &r->info));
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddDriverInfoCtr(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddDriverInfoCtr *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
            NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
            NDR_CHECK(ndr_pull_spoolss_AddDriverInfo(ndr, NDR_SCALARS, &r->info));
      }
      if (ndr_flags & NDR_BUFFERS) {
            NDR_CHECK(ndr_pull_spoolss_AddDriverInfo(ndr, NDR_BUFFERS, &r->info));
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddDriverInfoCtr(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfoCtr *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddDriverInfoCtr");
      ndr->depth++;
      ndr_print_uint32(ndr, "level", r->level);
      ndr_print_set_switch_value(ndr, &r->info, r->level);
      ndr_print_spoolss_AddDriverInfo(ndr, "info", &r->info);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo1 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo1");
      ndr->depth++;
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo1(const struct spoolss_DriverInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo1, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_path));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->config_file));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->config_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->config_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->config_file));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo2 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
                  if (_ptr_architecture) {
                        NDR_PULL_ALLOC(ndr, r->architecture);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
                  } else {
                        r->architecture = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
                  if (_ptr_driver_path) {
                        NDR_PULL_ALLOC(ndr, r->driver_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_path, _ptr_driver_path));
                  } else {
                        r->driver_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
                  if (_ptr_data_file) {
                        NDR_PULL_ALLOC(ndr, r->data_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_file, _ptr_data_file));
                  } else {
                        r->data_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
                  if (_ptr_config_file) {
                        NDR_PULL_ALLOC(ndr, r->config_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->config_file, _ptr_config_file));
                  } else {
                        r->config_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
                        _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_path));
                        _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_file));
                        _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->config_file));
                        _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->config_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo2");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo2(const struct spoolss_DriverInfo2 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo2, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo3 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_path));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->config_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->help_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dependent_files));
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->monitor_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->default_datatype));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->config_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->config_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->config_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->help_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->help_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->help_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dependent_files));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->dependent_files));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dependent_files));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->monitor_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->monitor_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->monitor_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->default_datatype));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->default_datatype));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->default_datatype));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo3 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
                  if (_ptr_architecture) {
                        NDR_PULL_ALLOC(ndr, r->architecture);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
                  } else {
                        r->architecture = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
                  if (_ptr_driver_path) {
                        NDR_PULL_ALLOC(ndr, r->driver_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_path, _ptr_driver_path));
                  } else {
                        r->driver_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
                  if (_ptr_data_file) {
                        NDR_PULL_ALLOC(ndr, r->data_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_file, _ptr_data_file));
                  } else {
                        r->data_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
                  if (_ptr_config_file) {
                        NDR_PULL_ALLOC(ndr, r->config_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->config_file, _ptr_config_file));
                  } else {
                        r->config_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
                  if (_ptr_help_file) {
                        NDR_PULL_ALLOC(ndr, r->help_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->help_file, _ptr_help_file));
                  } else {
                        r->help_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
                  if (_ptr_dependent_files) {
                        NDR_PULL_ALLOC(ndr, r->dependent_files);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dependent_files, _ptr_dependent_files));
                  } else {
                        r->dependent_files = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
                  if (_ptr_monitor_name) {
                        NDR_PULL_ALLOC(ndr, r->monitor_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->monitor_name, _ptr_monitor_name));
                  } else {
                        r->monitor_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
                  if (_ptr_default_datatype) {
                        NDR_PULL_ALLOC(ndr, r->default_datatype);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->default_datatype, _ptr_default_datatype));
                  } else {
                        r->default_datatype = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
                        _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_path));
                        _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_file));
                        _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->config_file));
                        _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->config_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->help_file));
                        _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->help_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dependent_files));
                        _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->dependent_files));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->monitor_name));
                        _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->default_datatype));
                        _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo3 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo3");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_string_array(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo3(const struct spoolss_DriverInfo3 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo3, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo4 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_path));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->config_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->help_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dependent_files));
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->monitor_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->default_datatype));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names));
                  ndr->flags = _flags_save_string_array;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->config_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->config_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->config_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->help_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->help_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->help_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dependent_files));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->dependent_files));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dependent_files));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->monitor_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->monitor_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->monitor_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->default_datatype));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->default_datatype));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->default_datatype));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->previous_names) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->previous_names));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->previous_names));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->previous_names));
                  }
                  ndr->flags = _flags_save_string_array;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo4 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_previous_names;
      TALLOC_CTX *_mem_save_previous_names_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
                  if (_ptr_architecture) {
                        NDR_PULL_ALLOC(ndr, r->architecture);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
                  } else {
                        r->architecture = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
                  if (_ptr_driver_path) {
                        NDR_PULL_ALLOC(ndr, r->driver_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_path, _ptr_driver_path));
                  } else {
                        r->driver_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
                  if (_ptr_data_file) {
                        NDR_PULL_ALLOC(ndr, r->data_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_file, _ptr_data_file));
                  } else {
                        r->data_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
                  if (_ptr_config_file) {
                        NDR_PULL_ALLOC(ndr, r->config_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->config_file, _ptr_config_file));
                  } else {
                        r->config_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
                  if (_ptr_help_file) {
                        NDR_PULL_ALLOC(ndr, r->help_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->help_file, _ptr_help_file));
                  } else {
                        r->help_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
                  if (_ptr_dependent_files) {
                        NDR_PULL_ALLOC(ndr, r->dependent_files);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dependent_files, _ptr_dependent_files));
                  } else {
                        r->dependent_files = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
                  if (_ptr_monitor_name) {
                        NDR_PULL_ALLOC(ndr, r->monitor_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->monitor_name, _ptr_monitor_name));
                  } else {
                        r->monitor_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
                  if (_ptr_default_datatype) {
                        NDR_PULL_ALLOC(ndr, r->default_datatype);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->default_datatype, _ptr_default_datatype));
                  } else {
                        r->default_datatype = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
                  if (_ptr_previous_names) {
                        NDR_PULL_ALLOC(ndr, r->previous_names);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous_names, _ptr_previous_names));
                  } else {
                        r->previous_names = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
                        _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_path));
                        _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_file));
                        _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->config_file));
                        _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->config_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->help_file));
                        _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->help_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dependent_files));
                        _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->dependent_files));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->monitor_name));
                        _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->default_datatype));
                        _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->previous_names) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous_names));
                        _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->previous_names));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo4 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo4");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_string_array(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_string_array(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo4(const struct spoolss_DriverInfo4 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo4, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo5 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_path));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->config_file));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_DriverAttributes(ndr, NDR_SCALARS, r->driver_attributes));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->config_version));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->driver_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->config_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->config_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->config_file));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo5 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
                  if (_ptr_architecture) {
                        NDR_PULL_ALLOC(ndr, r->architecture);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
                  } else {
                        r->architecture = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
                  if (_ptr_driver_path) {
                        NDR_PULL_ALLOC(ndr, r->driver_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_path, _ptr_driver_path));
                  } else {
                        r->driver_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
                  if (_ptr_data_file) {
                        NDR_PULL_ALLOC(ndr, r->data_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_file, _ptr_data_file));
                  } else {
                        r->data_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
                  if (_ptr_config_file) {
                        NDR_PULL_ALLOC(ndr, r->config_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->config_file, _ptr_config_file));
                  } else {
                        r->config_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_DriverAttributes(ndr, NDR_SCALARS, &r->driver_attributes));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->config_version));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->driver_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
                        _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_path));
                        _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_file));
                        _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->config_file));
                        _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->config_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo5 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo5");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_spoolss_DriverAttributes(ndr, "driver_attributes", r->driver_attributes);
      ndr_print_uint32(ndr, "config_version", r->config_version);
      ndr_print_uint32(ndr, "driver_version", r->driver_version);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo5(const struct spoolss_DriverInfo5 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo5, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo6 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 8));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_path));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->config_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->help_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dependent_files));
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->monitor_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->default_datatype));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names));
                  ndr->flags = _flags_save_string_array;
            }
            NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date));
            NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_url));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->hardware_id));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->provider));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->config_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->config_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->config_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->help_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->help_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->help_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dependent_files));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->dependent_files));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dependent_files));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->monitor_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->monitor_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->monitor_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->default_datatype));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->default_datatype));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->default_datatype));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->previous_names) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->previous_names));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->previous_names));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->previous_names));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->manufacturer_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->manufacturer_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_url) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->manufacturer_url));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_url));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->manufacturer_url));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->hardware_id) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->hardware_id));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->hardware_id));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->hardware_id));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->provider) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->provider));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->provider));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->provider));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo6 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_previous_names;
      TALLOC_CTX *_mem_save_previous_names_0;
      uint32_t _ptr_manufacturer_name;
      TALLOC_CTX *_mem_save_manufacturer_name_0;
      uint32_t _ptr_manufacturer_url;
      TALLOC_CTX *_mem_save_manufacturer_url_0;
      uint32_t _ptr_hardware_id;
      TALLOC_CTX *_mem_save_hardware_id_0;
      uint32_t _ptr_provider;
      TALLOC_CTX *_mem_save_provider_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 8));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
                  if (_ptr_architecture) {
                        NDR_PULL_ALLOC(ndr, r->architecture);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
                  } else {
                        r->architecture = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
                  if (_ptr_driver_path) {
                        NDR_PULL_ALLOC(ndr, r->driver_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_path, _ptr_driver_path));
                  } else {
                        r->driver_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
                  if (_ptr_data_file) {
                        NDR_PULL_ALLOC(ndr, r->data_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_file, _ptr_data_file));
                  } else {
                        r->data_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
                  if (_ptr_config_file) {
                        NDR_PULL_ALLOC(ndr, r->config_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->config_file, _ptr_config_file));
                  } else {
                        r->config_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
                  if (_ptr_help_file) {
                        NDR_PULL_ALLOC(ndr, r->help_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->help_file, _ptr_help_file));
                  } else {
                        r->help_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
                  if (_ptr_dependent_files) {
                        NDR_PULL_ALLOC(ndr, r->dependent_files);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dependent_files, _ptr_dependent_files));
                  } else {
                        r->dependent_files = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
                  if (_ptr_monitor_name) {
                        NDR_PULL_ALLOC(ndr, r->monitor_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->monitor_name, _ptr_monitor_name));
                  } else {
                        r->monitor_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
                  if (_ptr_default_datatype) {
                        NDR_PULL_ALLOC(ndr, r->default_datatype);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->default_datatype, _ptr_default_datatype));
                  } else {
                        r->default_datatype = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
                  if (_ptr_previous_names) {
                        NDR_PULL_ALLOC(ndr, r->previous_names);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous_names, _ptr_previous_names));
                  } else {
                        r->previous_names = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date));
            NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name));
                  if (_ptr_manufacturer_name) {
                        NDR_PULL_ALLOC(ndr, r->manufacturer_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_name, _ptr_manufacturer_name));
                  } else {
                        r->manufacturer_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_url));
                  if (_ptr_manufacturer_url) {
                        NDR_PULL_ALLOC(ndr, r->manufacturer_url);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_url, _ptr_manufacturer_url));
                  } else {
                        r->manufacturer_url = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hardware_id));
                  if (_ptr_hardware_id) {
                        NDR_PULL_ALLOC(ndr, r->hardware_id);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->hardware_id, _ptr_hardware_id));
                  } else {
                        r->hardware_id = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_provider));
                  if (_ptr_provider) {
                        NDR_PULL_ALLOC(ndr, r->provider);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->provider, _ptr_provider));
                  } else {
                        r->provider = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
                        _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_path));
                        _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_file));
                        _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->config_file));
                        _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->config_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->help_file));
                        _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->help_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dependent_files));
                        _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->dependent_files));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->monitor_name));
                        _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->default_datatype));
                        _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->previous_names) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous_names));
                        _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->previous_names));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_name));
                        _mem_save_manufacturer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_url) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_url));
                        _mem_save_manufacturer_url_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_url, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_url));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->hardware_id) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->hardware_id));
                        _mem_save_hardware_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->hardware_id, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->hardware_id));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->provider) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->provider));
                        _mem_save_provider_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->provider, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->provider));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo6 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo6");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_string_array(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_string_array(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "driver_date", r->driver_date);
      ndr_print_hyper(ndr, "driver_version", r->driver_version);
      ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name);
      ndr->depth++;
      if (r->manufacturer_name) {
            ndr_print_string(ndr, "manufacturer_name", r->manufacturer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "manufacturer_url", r->manufacturer_url);
      ndr->depth++;
      if (r->manufacturer_url) {
            ndr_print_string(ndr, "manufacturer_url", r->manufacturer_url);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "hardware_id", r->hardware_id);
      ndr->depth++;
      if (r->hardware_id) {
            ndr_print_string(ndr, "hardware_id", r->hardware_id);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "provider", r->provider);
      ndr->depth++;
      if (r->provider) {
            ndr_print_string(ndr, "provider", r->provider);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo6(const struct spoolss_DriverInfo6 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo6, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo8 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 8));
            NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_path));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->config_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->help_file));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->monitor_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->default_datatype));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dependent_files));
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names));
                  ndr->flags = _flags_save_string_array;
            }
            NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date));
            NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_name));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_url));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->hardware_id));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->provider));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->vendor_setup));
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->color_profiles));
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->inf_path));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->printer_driver_attributes));
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->core_driver_dependencies));
                  ndr->flags = _flags_save_string_array;
            }
            NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->min_inbox_driver_ver_date));
            NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->min_inbox_driver_ver_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->architecture));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->architecture));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->driver_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->driver_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->data_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->data_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->config_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->config_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->config_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->help_file));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->help_file));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->help_file));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->monitor_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->monitor_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->monitor_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->default_datatype));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->default_datatype));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->default_datatype));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dependent_files));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->dependent_files));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dependent_files));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->previous_names) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->previous_names));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->previous_names));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->previous_names));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->manufacturer_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->manufacturer_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_url) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->manufacturer_url));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_url));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->manufacturer_url));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->hardware_id) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->hardware_id));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->hardware_id));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->hardware_id));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->provider) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->provider));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->provider));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->provider));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->print_processor));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->print_processor));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->vendor_setup) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->vendor_setup));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->vendor_setup));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->vendor_setup));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->color_profiles) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->color_profiles));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->color_profiles));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->color_profiles));
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->inf_path) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->inf_path));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->inf_path));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->inf_path));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->core_driver_dependencies) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->core_driver_dependencies));
                        NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->core_driver_dependencies));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->core_driver_dependencies));
                  }
                  ndr->flags = _flags_save_string_array;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo8 *r)
{
      uint32_t _ptr_driver_name;
      TALLOC_CTX *_mem_save_driver_name_0;
      uint32_t _ptr_architecture;
      TALLOC_CTX *_mem_save_architecture_0;
      uint32_t _ptr_driver_path;
      TALLOC_CTX *_mem_save_driver_path_0;
      uint32_t _ptr_data_file;
      TALLOC_CTX *_mem_save_data_file_0;
      uint32_t _ptr_config_file;
      TALLOC_CTX *_mem_save_config_file_0;
      uint32_t _ptr_help_file;
      TALLOC_CTX *_mem_save_help_file_0;
      uint32_t _ptr_monitor_name;
      TALLOC_CTX *_mem_save_monitor_name_0;
      uint32_t _ptr_default_datatype;
      TALLOC_CTX *_mem_save_default_datatype_0;
      uint32_t _ptr_dependent_files;
      TALLOC_CTX *_mem_save_dependent_files_0;
      uint32_t _ptr_previous_names;
      TALLOC_CTX *_mem_save_previous_names_0;
      uint32_t _ptr_manufacturer_name;
      TALLOC_CTX *_mem_save_manufacturer_name_0;
      uint32_t _ptr_manufacturer_url;
      TALLOC_CTX *_mem_save_manufacturer_url_0;
      uint32_t _ptr_hardware_id;
      TALLOC_CTX *_mem_save_hardware_id_0;
      uint32_t _ptr_provider;
      TALLOC_CTX *_mem_save_provider_0;
      uint32_t _ptr_print_processor;
      TALLOC_CTX *_mem_save_print_processor_0;
      uint32_t _ptr_vendor_setup;
      TALLOC_CTX *_mem_save_vendor_setup_0;
      uint32_t _ptr_color_profiles;
      TALLOC_CTX *_mem_save_color_profiles_0;
      uint32_t _ptr_inf_path;
      TALLOC_CTX *_mem_save_inf_path_0;
      uint32_t _ptr_core_driver_dependencies;
      TALLOC_CTX *_mem_save_core_driver_dependencies_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 8));
            NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name));
                  if (_ptr_driver_name) {
                        NDR_PULL_ALLOC(ndr, r->driver_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name));
                  } else {
                        r->driver_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture));
                  if (_ptr_architecture) {
                        NDR_PULL_ALLOC(ndr, r->architecture);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture));
                  } else {
                        r->architecture = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_path));
                  if (_ptr_driver_path) {
                        NDR_PULL_ALLOC(ndr, r->driver_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_path, _ptr_driver_path));
                  } else {
                        r->driver_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_file));
                  if (_ptr_data_file) {
                        NDR_PULL_ALLOC(ndr, r->data_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_file, _ptr_data_file));
                  } else {
                        r->data_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_config_file));
                  if (_ptr_config_file) {
                        NDR_PULL_ALLOC(ndr, r->config_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->config_file, _ptr_config_file));
                  } else {
                        r->config_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_help_file));
                  if (_ptr_help_file) {
                        NDR_PULL_ALLOC(ndr, r->help_file);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->help_file, _ptr_help_file));
                  } else {
                        r->help_file = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name));
                  if (_ptr_monitor_name) {
                        NDR_PULL_ALLOC(ndr, r->monitor_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->monitor_name, _ptr_monitor_name));
                  } else {
                        r->monitor_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype));
                  if (_ptr_default_datatype) {
                        NDR_PULL_ALLOC(ndr, r->default_datatype);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->default_datatype, _ptr_default_datatype));
                  } else {
                        r->default_datatype = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dependent_files));
                  if (_ptr_dependent_files) {
                        NDR_PULL_ALLOC(ndr, r->dependent_files);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->dependent_files, _ptr_dependent_files));
                  } else {
                        r->dependent_files = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names));
                  if (_ptr_previous_names) {
                        NDR_PULL_ALLOC(ndr, r->previous_names);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous_names, _ptr_previous_names));
                  } else {
                        r->previous_names = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date));
            NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name));
                  if (_ptr_manufacturer_name) {
                        NDR_PULL_ALLOC(ndr, r->manufacturer_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_name, _ptr_manufacturer_name));
                  } else {
                        r->manufacturer_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_url));
                  if (_ptr_manufacturer_url) {
                        NDR_PULL_ALLOC(ndr, r->manufacturer_url);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_url, _ptr_manufacturer_url));
                  } else {
                        r->manufacturer_url = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hardware_id));
                  if (_ptr_hardware_id) {
                        NDR_PULL_ALLOC(ndr, r->hardware_id);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->hardware_id, _ptr_hardware_id));
                  } else {
                        r->hardware_id = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_provider));
                  if (_ptr_provider) {
                        NDR_PULL_ALLOC(ndr, r->provider);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->provider, _ptr_provider));
                  } else {
                        r->provider = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor));
                  if (_ptr_print_processor) {
                        NDR_PULL_ALLOC(ndr, r->print_processor);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->print_processor, _ptr_print_processor));
                  } else {
                        r->print_processor = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_vendor_setup));
                  if (_ptr_vendor_setup) {
                        NDR_PULL_ALLOC(ndr, r->vendor_setup);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->vendor_setup, _ptr_vendor_setup));
                  } else {
                        r->vendor_setup = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_color_profiles));
                  if (_ptr_color_profiles) {
                        NDR_PULL_ALLOC(ndr, r->color_profiles);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->color_profiles, _ptr_color_profiles));
                  } else {
                        r->color_profiles = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_inf_path));
                  if (_ptr_inf_path) {
                        NDR_PULL_ALLOC(ndr, r->inf_path);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->inf_path, _ptr_inf_path));
                  } else {
                        r->inf_path = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->printer_driver_attributes));
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_core_driver_dependencies));
                  if (_ptr_core_driver_dependencies) {
                        NDR_PULL_ALLOC(ndr, r->core_driver_dependencies);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->core_driver_dependencies, _ptr_core_driver_dependencies));
                  } else {
                        r->core_driver_dependencies = NULL;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->min_inbox_driver_ver_date));
            NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->min_inbox_driver_ver_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name));
                        _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->architecture) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture));
                        _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->driver_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_path));
                        _mem_save_driver_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->driver_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->data_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_file));
                        _mem_save_data_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->data_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->config_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->config_file));
                        _mem_save_config_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->config_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->config_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_config_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->help_file) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->help_file));
                        _mem_save_help_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->help_file, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->help_file));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_help_file_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->monitor_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->monitor_name));
                        _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->default_datatype) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->default_datatype));
                        _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->dependent_files) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->dependent_files));
                        _mem_save_dependent_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->dependent_files, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->dependent_files));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dependent_files_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->previous_names) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous_names));
                        _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->previous_names));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_name));
                        _mem_save_manufacturer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->manufacturer_url) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_url));
                        _mem_save_manufacturer_url_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_url, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_url));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->hardware_id) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->hardware_id));
                        _mem_save_hardware_id_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->hardware_id, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->hardware_id));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->provider) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->provider));
                        _mem_save_provider_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->provider, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->provider));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->print_processor));
                        _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->print_processor));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->vendor_setup) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->vendor_setup));
                        _mem_save_vendor_setup_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->vendor_setup, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->vendor_setup));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_vendor_setup_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->color_profiles) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->color_profiles));
                        _mem_save_color_profiles_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->color_profiles, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->color_profiles));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_color_profiles_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->inf_path) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->inf_path));
                        _mem_save_inf_path_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->inf_path, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->inf_path));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_inf_path_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string_array = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->core_driver_dependencies) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->core_driver_dependencies));
                        _mem_save_core_driver_dependencies_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->core_driver_dependencies, 0);
                        NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->core_driver_dependencies));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_core_driver_dependencies_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string_array;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo8 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverInfo8");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "driver_path", r->driver_path);
      ndr->depth++;
      if (r->driver_path) {
            ndr_print_string(ndr, "driver_path", r->driver_path);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "data_file", r->data_file);
      ndr->depth++;
      if (r->data_file) {
            ndr_print_string(ndr, "data_file", r->data_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "config_file", r->config_file);
      ndr->depth++;
      if (r->config_file) {
            ndr_print_string(ndr, "config_file", r->config_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "help_file", r->help_file);
      ndr->depth++;
      if (r->help_file) {
            ndr_print_string(ndr, "help_file", r->help_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "dependent_files", r->dependent_files);
      ndr->depth++;
      if (r->dependent_files) {
            ndr_print_string_array(ndr, "dependent_files", r->dependent_files);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_string_array(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "driver_date", r->driver_date);
      ndr_print_hyper(ndr, "driver_version", r->driver_version);
      ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name);
      ndr->depth++;
      if (r->manufacturer_name) {
            ndr_print_string(ndr, "manufacturer_name", r->manufacturer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "manufacturer_url", r->manufacturer_url);
      ndr->depth++;
      if (r->manufacturer_url) {
            ndr_print_string(ndr, "manufacturer_url", r->manufacturer_url);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "hardware_id", r->hardware_id);
      ndr->depth++;
      if (r->hardware_id) {
            ndr_print_string(ndr, "hardware_id", r->hardware_id);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "provider", r->provider);
      ndr->depth++;
      if (r->provider) {
            ndr_print_string(ndr, "provider", r->provider);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "print_processor", r->print_processor);
      ndr->depth++;
      if (r->print_processor) {
            ndr_print_string(ndr, "print_processor", r->print_processor);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "vendor_setup", r->vendor_setup);
      ndr->depth++;
      if (r->vendor_setup) {
            ndr_print_string(ndr, "vendor_setup", r->vendor_setup);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "color_profiles", r->color_profiles);
      ndr->depth++;
      if (r->color_profiles) {
            ndr_print_string_array(ndr, "color_profiles", r->color_profiles);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "inf_path", r->inf_path);
      ndr->depth++;
      if (r->inf_path) {
            ndr_print_string(ndr, "inf_path", r->inf_path);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "printer_driver_attributes", r->printer_driver_attributes);
      ndr_print_ptr(ndr, "core_driver_dependencies", r->core_driver_dependencies);
      ndr->depth++;
      if (r->core_driver_dependencies) {
            ndr_print_string_array(ndr, "core_driver_dependencies", r->core_driver_dependencies);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "min_inbox_driver_ver_date", r->min_inbox_driver_ver_date);
      ndr_print_hyper(ndr, "min_inbox_driver_ver_version", r->min_inbox_driver_ver_version);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo8(const struct spoolss_DriverInfo8 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo8, ic);
}

static enum ndr_err_code ndr_push_spoolss_DriverFileType(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverFileType r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DriverFileType(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverFileType *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverFileType(struct ndr_print *ndr, const char *name, enum spoolss_DriverFileType r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_DRIVER_FILE_TYPE_RENDERING: val = "SPOOLSS_DRIVER_FILE_TYPE_RENDERING"; break;
            case SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION: val = "SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION"; break;
            case SPOOLSS_DRIVER_FILE_TYPE_DATA: val = "SPOOLSS_DRIVER_FILE_TYPE_DATA"; break;
            case SPOOLSS_DRIVER_FILE_TYPE_HELP: val = "SPOOLSS_DRIVER_FILE_TYPE_HELP"; break;
            case SPOOLSS_DRIVER_FILE_TYPE_OTHER: val = "SPOOLSS_DRIVER_FILE_TYPE_OTHER"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverFileInfo(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverFileInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->file_name));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_DriverFileType(ndr, NDR_SCALARS, r->file_type));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->file_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->file_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->file_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->file_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->file_name));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverFileInfo(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverFileInfo *r)
{
      uint32_t _ptr_file_name;
      TALLOC_CTX *_mem_save_file_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_file_name));
                  if (_ptr_file_name) {
                        NDR_PULL_ALLOC(ndr, r->file_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->file_name, _ptr_file_name));
                  } else {
                        r->file_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_DriverFileType(ndr, NDR_SCALARS, &r->file_type));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->file_version));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->file_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->file_name));
                        _mem_save_file_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->file_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->file_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverFileInfo(struct ndr_print *ndr, const char *name, const struct spoolss_DriverFileInfo *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverFileInfo");
      ndr->depth++;
      ndr_print_ptr(ndr, "file_name", r->file_name);
      ndr->depth++;
      if (r->file_name) {
            ndr_print_string(ndr, "file_name", r->file_name);
      }
      ndr->depth--;
      ndr_print_spoolss_DriverFileType(ndr, "file_type", r->file_type);
      ndr_print_uint32(ndr, "file_version", r->file_version);
      ndr->depth--;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo101(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo101 *r)
{
      uint32_t cntr_file_info_1;
      ndr_print_struct(ndr, name, "spoolss_DriverInfo101");
      ndr->depth++;
      ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version);
      ndr_print_ptr(ndr, "driver_name", r->driver_name);
      ndr->depth++;
      if (r->driver_name) {
            ndr_print_string(ndr, "driver_name", r->driver_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "architecture", r->architecture);
      ndr->depth++;
      if (r->architecture) {
            ndr_print_string(ndr, "architecture", r->architecture);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "file_info", r->file_info);
      ndr->depth++;
      if (r->file_info) {
            ndr->print(ndr, "%s: ARRAY(%d)", "file_info", (int)r->file_count);
            ndr->depth++;
            for (cntr_file_info_1=0;cntr_file_info_1<r->file_count;cntr_file_info_1++) {
                  char *idx_1=NULL;
                  if (asprintf(&idx_1, "[%d]", cntr_file_info_1) != -1) {
                        ndr_print_spoolss_DriverFileInfo(ndr, "file_info", &r->file_info[cntr_file_info_1]);
                        free(idx_1);
                  }
            }
            ndr->depth--;
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "file_count", r->file_count);
      ndr_print_ptr(ndr, "monitor_name", r->monitor_name);
      ndr->depth++;
      if (r->monitor_name) {
            ndr_print_string(ndr, "monitor_name", r->monitor_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "default_datatype", r->default_datatype);
      ndr->depth++;
      if (r->default_datatype) {
            ndr_print_string(ndr, "default_datatype", r->default_datatype);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "previous_names", r->previous_names);
      ndr->depth++;
      if (r->previous_names) {
            ndr_print_string_array(ndr, "previous_names", r->previous_names);
      }
      ndr->depth--;
      ndr_print_NTTIME(ndr, "driver_date", r->driver_date);
      ndr_print_hyper(ndr, "driver_version", r->driver_version);
      ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name);
      ndr->depth++;
      if (r->manufacturer_name) {
            ndr_print_string(ndr, "manufacturer_name", r->manufacturer_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "manufacturer_url", r->manufacturer_url);
      ndr->depth++;
      if (r->manufacturer_url) {
            ndr_print_string(ndr, "manufacturer_url", r->manufacturer_url);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "hardware_id", r->hardware_id);
      ndr->depth++;
      if (r->hardware_id) {
            ndr_print_string(ndr, "hardware_id", r->hardware_id);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "provider", r->provider);
      ndr->depth++;
      if (r->provider) {
            ndr_print_string(ndr, "provider", r->provider);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo101(const struct spoolss_DriverInfo101 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo101, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_DriverInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        case 3: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo3(ndr, NDR_SCALARS, &r->info3));
                        break; }

                        case 4: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo4(ndr, NDR_SCALARS, &r->info4));
                        break; }

                        case 5: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo5(ndr, NDR_SCALARS, &r->info5));
                        break; }

                        case 6: {
                              NDR_CHECK(ndr_push_align(ndr, 8));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo6(ndr, NDR_SCALARS, &r->info6));
                        break; }

                        case 8: {
                              NDR_CHECK(ndr_push_align(ndr, 8));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo8(ndr, NDR_SCALARS, &r->info8));
                        break; }

                        case 101: {
                              NDR_CHECK(ndr_push_align(ndr, 8));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverInfo101(ndr, NDR_SCALARS, &r->info101));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        case 3:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo3(ndr, NDR_BUFFERS, &r->info3));
                        break;

                        case 4:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo4(ndr, NDR_BUFFERS, &r->info4));
                        break;

                        case 5:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo5(ndr, NDR_BUFFERS, &r->info5));
                        break;

                        case 6:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo6(ndr, NDR_BUFFERS, &r->info6));
                        break;

                        case 8:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo8(ndr, NDR_BUFFERS, &r->info8));
                        break;

                        case 101:
                              NDR_CHECK(ndr_push_spoolss_DriverInfo101(ndr, NDR_BUFFERS, &r->info101));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_DriverInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        case 3: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo3(ndr, NDR_SCALARS, &r->info3));
                        break; }

                        case 4: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo4(ndr, NDR_SCALARS, &r->info4));
                        break; }

                        case 5: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo5(ndr, NDR_SCALARS, &r->info5));
                        break; }

                        case 6: {
                              NDR_CHECK(ndr_pull_align(ndr, 8));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo6(ndr, NDR_SCALARS, &r->info6));
                        break; }

                        case 8: {
                              NDR_CHECK(ndr_pull_align(ndr, 8));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo8(ndr, NDR_SCALARS, &r->info8));
                        break; }

                        case 101: {
                              NDR_CHECK(ndr_pull_align(ndr, 8));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo101(ndr, NDR_SCALARS, &r->info101));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        case 3:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo3(ndr, NDR_BUFFERS, &r->info3));
                        break;

                        case 4:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo4(ndr, NDR_BUFFERS, &r->info4));
                        break;

                        case 5:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo5(ndr, NDR_BUFFERS, &r->info5));
                        break;

                        case 6:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo6(ndr, NDR_BUFFERS, &r->info6));
                        break;

                        case 8:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo8(ndr, NDR_BUFFERS, &r->info8));
                        break;

                        case 101:
                              NDR_CHECK(ndr_pull_spoolss_DriverInfo101(ndr, NDR_BUFFERS, &r->info101));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverInfo(struct ndr_print *ndr, const char *name, const union spoolss_DriverInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_DriverInfo");
            switch (level) {
                  case 1:
                        ndr_print_spoolss_DriverInfo1(ndr, "info1", &r->info1);
                  break;

                  case 2:
                        ndr_print_spoolss_DriverInfo2(ndr, "info2", &r->info2);
                  break;

                  case 3:
                        ndr_print_spoolss_DriverInfo3(ndr, "info3", &r->info3);
                  break;

                  case 4:
                        ndr_print_spoolss_DriverInfo4(ndr, "info4", &r->info4);
                  break;

                  case 5:
                        ndr_print_spoolss_DriverInfo5(ndr, "info5", &r->info5);
                  break;

                  case 6:
                        ndr_print_spoolss_DriverInfo6(ndr, "info6", &r->info6);
                  break;

                  case 8:
                        ndr_print_spoolss_DriverInfo8(ndr, "info8", &r->info8);
                  break;

                  case 101:
                        ndr_print_spoolss_DriverInfo101(ndr, "info101", &r->info101);
                  break;

                  default:
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ size_t ndr_size_spoolss_DriverInfo(const union spoolss_DriverInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      flags |= LIBNDR_FLAG_RELATIVE_REVERSE;
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverDirectoryInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverDirectoryInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->directory_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverDirectoryInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverDirectoryInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->directory_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverDirectoryInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_DriverDirectoryInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DriverDirectoryInfo1");
      ndr->depth++;
      ndr_print_string(ndr, "directory_name", r->directory_name);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_DriverDirectoryInfo1(const struct spoolss_DriverDirectoryInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverDirectoryInfo1, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverDirectoryInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_DriverDirectoryInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        default: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_DriverDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverDirectoryInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_DriverDirectoryInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        default: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_DriverDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DriverDirectoryInfo(struct ndr_print *ndr, const char *name, const union spoolss_DriverDirectoryInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_DriverDirectoryInfo");
            switch (level) {
                  case 1:
                        ndr_print_spoolss_DriverDirectoryInfo1(ndr, "info1", &r->info1);
                  break;

                  default:
                        ndr_print_spoolss_DriverDirectoryInfo1(ndr, "info1", &r->info1);
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ size_t ndr_size_spoolss_DriverDirectoryInfo(const union spoolss_DriverDirectoryInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      flags |= LIBNDR_FLAG_RELATIVE_REVERSE;
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverDirectoryInfo, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcessorInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->print_processor_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->print_processor_name));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcessorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcessorInfo1 *r)
{
      uint32_t _ptr_print_processor_name;
      TALLOC_CTX *_mem_save_print_processor_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor_name));
                  if (_ptr_print_processor_name) {
                        NDR_PULL_ALLOC(ndr, r->print_processor_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->print_processor_name, _ptr_print_processor_name));
                  } else {
                        r->print_processor_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->print_processor_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->print_processor_name));
                        _mem_save_print_processor_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->print_processor_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->print_processor_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrintProcessorInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrintProcessorInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrintProcessorInfo1");
      ndr->depth++;
      ndr_print_ptr(ndr, "print_processor_name", r->print_processor_name);
      ndr->depth++;
      if (r->print_processor_name) {
            ndr_print_string(ndr, "print_processor_name", r->print_processor_name);
      }
      ndr->depth--;
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrintProcessorInfo1(const struct spoolss_PrintProcessorInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcessorInfo1, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrintProcessorInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrintProcessorInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_push_spoolss_PrintProcessorInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcessorInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrintProcessorInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrintProcessorInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_pull_spoolss_PrintProcessorInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrintProcessorInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrintProcessorInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_PrintProcessorInfo");
            switch (level) {
                  case 1:
                        ndr_print_spoolss_PrintProcessorInfo1(ndr, "info1", &r->info1);
                  break;

                  default:
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorDirectoryInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcessorDirectoryInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->directory_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcessorDirectoryInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcessorDirectoryInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->directory_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrintProcessorDirectoryInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrintProcessorDirectoryInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_PrintProcessorDirectoryInfo1");
      ndr->depth++;
      ndr_print_string(ndr, "directory_name", r->directory_name);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_PrintProcessorDirectoryInfo1(const struct spoolss_PrintProcessorDirectoryInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcessorDirectoryInfo1, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorDirectoryInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrintProcessorDirectoryInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrintProcessorDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        default: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_PrintProcessorDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcessorDirectoryInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrintProcessorDirectoryInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrintProcessorDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        default: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_PrintProcessorDirectoryInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrintProcessorDirectoryInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrintProcessorDirectoryInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_PrintProcessorDirectoryInfo");
            switch (level) {
                  case 1:
                        ndr_print_spoolss_PrintProcessorDirectoryInfo1(ndr, "info1", &r->info1);
                  break;

                  default:
                        ndr_print_spoolss_PrintProcessorDirectoryInfo1(ndr, "info1", &r->info1);
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ size_t ndr_size_spoolss_PrintProcessorDirectoryInfo(const union spoolss_PrintProcessorDirectoryInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      flags |= LIBNDR_FLAG_RELATIVE_REVERSE;
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcessorDirectoryInfo, ic);
}

static enum ndr_err_code ndr_push_spoolss_DocumentInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DocumentInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->output_file));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->datatype));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->document_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->output_file) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->output_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->output_file, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->output_file, ndr_charset_length(r->output_file, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->datatype) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->datatype, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->datatype, ndr_charset_length(r->datatype, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DocumentInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DocumentInfo1 *r)
{
      uint32_t _ptr_document_name;
      TALLOC_CTX *_mem_save_document_name_0;
      uint32_t _ptr_output_file;
      TALLOC_CTX *_mem_save_output_file_0;
      uint32_t _ptr_datatype;
      TALLOC_CTX *_mem_save_datatype_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name));
            if (_ptr_document_name) {
                  NDR_PULL_ALLOC(ndr, r->document_name);
            } else {
                  r->document_name = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_output_file));
            if (_ptr_output_file) {
                  NDR_PULL_ALLOC(ndr, r->output_file);
            } else {
                  r->output_file = NULL;
            }
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_datatype));
            if (_ptr_datatype) {
                  NDR_PULL_ALLOC(ndr, r->datatype);
            } else {
                  r->datatype = NULL;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->document_name) {
                  _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name));
                  if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0);
            }
            if (r->output_file) {
                  _mem_save_output_file_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->output_file, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->output_file));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->output_file));
                  if (ndr_get_array_length(ndr, &r->output_file) > ndr_get_array_size(ndr, &r->output_file)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->output_file), ndr_get_array_length(ndr, &r->output_file));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->output_file), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->output_file, ndr_get_array_length(ndr, &r->output_file), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_output_file_0, 0);
            }
            if (r->datatype) {
                  _mem_save_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->datatype, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->datatype));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->datatype));
                  if (ndr_get_array_length(ndr, &r->datatype) > ndr_get_array_size(ndr, &r->datatype)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->datatype), ndr_get_array_length(ndr, &r->datatype));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->datatype), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->datatype, ndr_get_array_length(ndr, &r->datatype), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_datatype_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DocumentInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_DocumentInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_DocumentInfo1");
      ndr->depth++;
      ndr_print_ptr(ndr, "document_name", r->document_name);
      ndr->depth++;
      if (r->document_name) {
            ndr_print_string(ndr, "document_name", r->document_name);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "output_file", r->output_file);
      ndr->depth++;
      if (r->output_file) {
            ndr_print_string(ndr, "output_file", r->output_file);
      }
      ndr->depth--;
      ndr_print_ptr(ndr, "datatype", r->datatype);
      ndr->depth++;
      if (r->datatype) {
            ndr_print_string(ndr, "datatype", r->datatype);
      }
      ndr->depth--;
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_DocumentInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_DocumentInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            int level = ndr_push_get_switch_value(ndr, r);
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
            switch (level) {
                  case 1: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
                  break; }

                  case 2: {
                  break; }

                  case 3: {
                  break; }

                  default: {
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case 1:
                        if (r->info1) {
                              NDR_CHECK(ndr_push_spoolss_DocumentInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                        }
                  break;

                  case 2:
                  break;

                  case 3:
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_DocumentInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_DocumentInfo *r)
{
      int level;
      uint32_t _level;
      TALLOC_CTX *_mem_save_info1_0;
      level = ndr_pull_get_switch_value(ndr, r);
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
            if (_level != level) {
                  return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
            }
            switch (level) {
                  case 1: {
                        uint32_t _ptr_info1;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
                        if (_ptr_info1) {
                              NDR_PULL_ALLOC(ndr, r->info1);
                        } else {
                              r->info1 = NULL;
                        }
                  break; }

                  case 2: {
                  break; }

                  case 3: {
                  break; }

                  default: {
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            switch (level) {
                  case 1:
                        if (r->info1) {
                              _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
                              NDR_CHECK(ndr_pull_spoolss_DocumentInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
                        }
                  break;

                  case 2:
                  break;

                  case 3:
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_DocumentInfo(struct ndr_print *ndr, const char *name, const union spoolss_DocumentInfo *r)
{
      int level;
      level = ndr_print_get_switch_value(ndr, r);
      ndr_print_union(ndr, name, level, "spoolss_DocumentInfo");
      switch (level) {
            case 1:
                  ndr_print_ptr(ndr, "info1", r->info1);
                  ndr->depth++;
                  if (r->info1) {
                        ndr_print_spoolss_DocumentInfo1(ndr, "info1", r->info1);
                  }
                  ndr->depth--;
            break;

            case 2:
            break;

            case 3:
            break;

            default:
            break;

      }
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_OSVersion(struct ndr_push *ndr, int ndr_flags, const struct spoolss_OSVersion *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_spoolss_OSVersion(r, ndr->iconv_convenience, ndr->flags)));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->major));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minor));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->build));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  {
                        struct ndr_push *_ndr_extra_string;
                        NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_extra_string, 0, 256));
                        NDR_CHECK(ndr_push_string(_ndr_extra_string, NDR_SCALARS, r->extra_string));
                        NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_extra_string, 0, 256));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_OSVersion(struct ndr_pull *ndr, int ndr_flags, struct spoolss_OSVersion *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->major));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minor));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->build));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  {
                        struct ndr_pull *_ndr_extra_string;
                        NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_extra_string, 0, 256));
                        NDR_CHECK(ndr_pull_string(_ndr_extra_string, NDR_SCALARS, &r->extra_string));
                        NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_extra_string, 0, 256));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_OSVersion(struct ndr_print *ndr, const char *name, const struct spoolss_OSVersion *r)
{
      ndr_print_struct(ndr, name, "spoolss_OSVersion");
      ndr->depth++;
      ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_OSVersion(r, ndr->iconv_convenience, ndr->flags):r->_ndr_size);
      ndr_print_uint32(ndr, "major", r->major);
      ndr_print_uint32(ndr, "minor", r->minor);
      ndr_print_uint32(ndr, "build", r->build);
      ndr_print_uint32(ndr, "unknown", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->unknown);
      ndr_print_string(ndr, "extra_string", r->extra_string);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_OSVersion(const struct spoolss_OSVersion *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersion, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_OSVersionEx(struct ndr_push *ndr, int ndr_flags, const struct spoolss_OSVersionEx *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_spoolss_OSVersionEx(r, ndr->iconv_convenience, ndr->flags)));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->major));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->minor));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->build));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  {
                        struct ndr_push *_ndr_extra_string;
                        NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_extra_string, 0, 256));
                        NDR_CHECK(ndr_push_string(_ndr_extra_string, NDR_SCALARS, r->extra_string));
                        NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_extra_string, 0, 256));
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown3));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_OSVersionEx(struct ndr_pull *ndr, int ndr_flags, struct spoolss_OSVersionEx *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_ndr_size));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->major));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->minor));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->build));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  {
                        struct ndr_pull *_ndr_extra_string;
                        NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_extra_string, 0, 256));
                        NDR_CHECK(ndr_pull_string(_ndr_extra_string, NDR_SCALARS, &r->extra_string));
                        NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_extra_string, 0, 256));
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_OSVersionEx(struct ndr_print *ndr, const char *name, const struct spoolss_OSVersionEx *r)
{
      ndr_print_struct(ndr, name, "spoolss_OSVersionEx");
      ndr->depth++;
      ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_OSVersionEx(r, ndr->iconv_convenience, ndr->flags):r->_ndr_size);
      ndr_print_uint32(ndr, "major", r->major);
      ndr_print_uint32(ndr, "minor", r->minor);
      ndr_print_uint32(ndr, "build", r->build);
      ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->unknown1);
      ndr_print_string(ndr, "extra_string", r->extra_string);
      ndr_print_uint32(ndr, "unknown2", r->unknown2);
      ndr_print_uint32(ndr, "unknown3", r->unknown3);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_OSVersionEx(const struct spoolss_OSVersionEx *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterData(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrinterData *r)
{
      if (ndr_flags & NDR_SCALARS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case REG_NONE: {
                  break; }

                  case REG_SZ: {
                        {
                              uint32_t _flags_save_string = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                              NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string));
                              ndr->flags = _flags_save_string;
                        }
                  break; }

                  case REG_BINARY: {
                        {
                              uint32_t _flags_save_DATA_BLOB = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
                              NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
                              ndr->flags = _flags_save_DATA_BLOB;
                        }
                  break; }

                  case REG_DWORD: {
                        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value));
                  break; }

                  case REG_MULTI_SZ: {
                        {
                              uint32_t _flags_save_string_array = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                              NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->string_array));
                              ndr->flags = _flags_save_string_array;
                        }
                  break; }

                  default: {
                        {
                              uint32_t _flags_save_DATA_BLOB = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
                              NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
                              ndr->flags = _flags_save_DATA_BLOB;
                        }
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case REG_NONE:
                  break;

                  case REG_SZ:
                  break;

                  case REG_BINARY:
                  break;

                  case REG_DWORD:
                  break;

                  case REG_MULTI_SZ:
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterData(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrinterData *r)
{
      int level;
      level = ndr_pull_get_switch_value(ndr, r);
      if (ndr_flags & NDR_SCALARS) {
            switch (level) {
                  case REG_NONE: {
                  break; }

                  case REG_SZ: {
                        {
                              uint32_t _flags_save_string = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                              NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string));
                              ndr->flags = _flags_save_string;
                        }
                  break; }

                  case REG_BINARY: {
                        {
                              uint32_t _flags_save_DATA_BLOB = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
                              NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
                              ndr->flags = _flags_save_DATA_BLOB;
                        }
                  break; }

                  case REG_DWORD: {
                        NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value));
                  break; }

                  case REG_MULTI_SZ: {
                        {
                              uint32_t _flags_save_string_array = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                              NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->string_array));
                              ndr->flags = _flags_save_string_array;
                        }
                  break; }

                  default: {
                        {
                              uint32_t _flags_save_DATA_BLOB = ndr->flags;
                              ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
                              NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
                              ndr->flags = _flags_save_DATA_BLOB;
                        }
                  break; }

            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            switch (level) {
                  case REG_NONE:
                  break;

                  case REG_SZ:
                  break;

                  case REG_BINARY:
                  break;

                  case REG_DWORD:
                  break;

                  case REG_MULTI_SZ:
                  break;

                  default:
                  break;

            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PrinterData(struct ndr_print *ndr, const char *name, const union spoolss_PrinterData *r)
{
      int level;
      level = ndr_print_get_switch_value(ndr, r);
      ndr_print_union(ndr, name, level, "spoolss_PrinterData");
      switch (level) {
            case REG_NONE:
            break;

            case REG_SZ:
                  ndr_print_string(ndr, "string", r->string);
            break;

            case REG_BINARY:
                  ndr_print_DATA_BLOB(ndr, "binary", r->binary);
            break;

            case REG_DWORD:
                  ndr_print_uint32(ndr, "value", r->value);
            break;

            case REG_MULTI_SZ:
                  ndr_print_string_array(ndr, "string_array", r->string_array);
            break;

            default:
                  ndr_print_DATA_BLOB(ndr, "data", r->data);
            break;

      }
}

_PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData, ic);
}

static enum ndr_err_code ndr_push_spoolss_FormFlags(struct ndr_push *ndr, int ndr_flags, enum spoolss_FormFlags r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_FormFlags(struct ndr_pull *ndr, int ndr_flags, enum spoolss_FormFlags *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormFlags(struct ndr_print *ndr, const char *name, enum spoolss_FormFlags r)
{
      const char *val = NULL;

      switch (r) {
            case SPOOLSS_FORM_USER: val = "SPOOLSS_FORM_USER"; break;
            case SPOOLSS_FORM_BUILTIN: val = "SPOOLSS_FORM_BUILTIN"; break;
            case SPOOLSS_FORM_PRINTER: val = "SPOOLSS_FORM_PRINTER"; break;
      }
      ndr_print_enum(ndr, name, "ENUM", val, r);
}

static enum ndr_err_code ndr_push_spoolss_FormSize(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormSize *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->width));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->height));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_FormSize(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormSize *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->width));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->height));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormSize(struct ndr_print *ndr, const char *name, const struct spoolss_FormSize *r)
{
      ndr_print_struct(ndr, name, "spoolss_FormSize");
      ndr->depth++;
      ndr_print_uint32(ndr, "width", r->width);
      ndr_print_uint32(ndr, "height", r->height);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_FormArea(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormArea *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->left));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->top));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->right));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->bottom));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_FormArea(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormArea *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->left));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->top));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->right));
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->bottom));
      }
      if (ndr_flags & NDR_BUFFERS) {
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormArea(struct ndr_print *ndr, const char *name, const struct spoolss_FormArea *r)
{
      ndr_print_struct(ndr, name, "spoolss_FormArea");
      ndr->depth++;
      ndr_print_uint32(ndr, "left", r->left);
      ndr_print_uint32(ndr, "top", r->top);
      ndr_print_uint32(ndr, "right", r->right);
      ndr_print_uint32(ndr, "bottom", r->bottom);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_FormFlags(ndr, NDR_SCALARS, r->flags));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->form_name));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_push_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->form_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->form_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->form_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->form_name));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_FormInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo1 *r)
{
      uint32_t _ptr_form_name;
      TALLOC_CTX *_mem_save_form_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_FormFlags(ndr, NDR_SCALARS, &r->flags));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_form_name));
                  if (_ptr_form_name) {
                        NDR_PULL_ALLOC(ndr, r->form_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->form_name, _ptr_form_name));
                  } else {
                        r->form_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->form_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->form_name));
                        _mem_save_form_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->form_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->form_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_form_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_FormInfo1");
      ndr->depth++;
      ndr_print_spoolss_FormFlags(ndr, "flags", r->flags);
      ndr_print_ptr(ndr, "form_name", r->form_name);
      ndr->depth++;
      if (r->form_name) {
            ndr_print_string(ndr, "form_name", r->form_name);
      }
      ndr->depth--;
      ndr_print_spoolss_FormSize(ndr, "size", &r->size);
      ndr_print_spoolss_FormArea(ndr, "area", &r->area);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_FormInfo1(const struct spoolss_FormInfo1 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo1, ic);
}

static enum ndr_err_code ndr_push_spoolss_FormStringType(struct ndr_push *ndr, int ndr_flags, uint32_t r)
{
      NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_FormStringType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
{
      uint32_t v;
      NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      *r = v;
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormStringType(struct ndr_print *ndr, const char *name, uint32_t r)
{
      ndr_print_uint32(ndr, name, r);
      ndr->depth++;
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SPOOLSS_FORM_STRING_TYPE_NONE", SPOOLSS_FORM_STRING_TYPE_NONE, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SPOOLSS_FORM_STRING_TYPE_MUI_DLL", SPOOLSS_FORM_STRING_TYPE_MUI_DLL, r);
      ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SPOOLSS_FORM_STRING_TYPE_LANG_PAIR", SPOOLSS_FORM_STRING_TYPE_LANG_PAIR, r);
      ndr->depth--;
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_FormFlags(ndr, NDR_SCALARS, r->flags));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->form_name));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_push_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->keyword));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_spoolss_FormStringType(ndr, NDR_SCALARS, r->string_type));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->mui_dll));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ressource_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name));
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lang_id));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->form_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->form_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->form_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->form_name));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
                  if (r->keyword) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->keyword));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->keyword));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->keyword));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->mui_dll) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->mui_dll));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mui_dll));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->mui_dll));
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->display_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->display_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->display_name));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_FormInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo2 *r)
{
      uint32_t _ptr_form_name;
      TALLOC_CTX *_mem_save_form_name_0;
      uint32_t _ptr_keyword;
      TALLOC_CTX *_mem_save_keyword_0;
      uint32_t _ptr_mui_dll;
      TALLOC_CTX *_mem_save_mui_dll_0;
      uint32_t _ptr_display_name;
      TALLOC_CTX *_mem_save_display_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_FormFlags(ndr, NDR_SCALARS, &r->flags));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_form_name));
                  if (_ptr_form_name) {
                        NDR_PULL_ALLOC(ndr, r->form_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->form_name, _ptr_form_name));
                  } else {
                        r->form_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyword));
                  if (_ptr_keyword) {
                        NDR_PULL_ALLOC(ndr, r->keyword);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->keyword, _ptr_keyword));
                  } else {
                        r->keyword = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_spoolss_FormStringType(ndr, NDR_SCALARS, &r->string_type));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mui_dll));
                  if (_ptr_mui_dll) {
                        NDR_PULL_ALLOC(ndr, r->mui_dll);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->mui_dll, _ptr_mui_dll));
                  } else {
                        r->mui_dll = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ressource_id));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
                  if (_ptr_display_name) {
                        NDR_PULL_ALLOC(ndr, r->display_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name));
                  } else {
                        r->display_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lang_id));
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->form_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->form_name));
                        _mem_save_form_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->form_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->form_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_form_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
                  if (r->keyword) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->keyword));
                        _mem_save_keyword_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->keyword, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->keyword));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyword_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->mui_dll) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->mui_dll));
                        _mem_save_mui_dll_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->mui_dll, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mui_dll));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mui_dll_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->display_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name));
                        _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_FormInfo2");
      ndr->depth++;
      ndr_print_spoolss_FormFlags(ndr, "flags", r->flags);
      ndr_print_ptr(ndr, "form_name", r->form_name);
      ndr->depth++;
      if (r->form_name) {
            ndr_print_string(ndr, "form_name", r->form_name);
      }
      ndr->depth--;
      ndr_print_spoolss_FormSize(ndr, "size", &r->size);
      ndr_print_spoolss_FormArea(ndr, "area", &r->area);
      ndr_print_ptr(ndr, "keyword", r->keyword);
      ndr->depth++;
      if (r->keyword) {
            ndr_print_string(ndr, "keyword", r->keyword);
      }
      ndr->depth--;
      ndr_print_spoolss_FormStringType(ndr, "string_type", r->string_type);
      ndr_print_ptr(ndr, "mui_dll", r->mui_dll);
      ndr->depth++;
      if (r->mui_dll) {
            ndr_print_string(ndr, "mui_dll", r->mui_dll);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "ressource_id", r->ressource_id);
      ndr_print_ptr(ndr, "display_name", r->display_name);
      ndr->depth++;
      if (r->display_name) {
            ndr_print_string(ndr, "display_name", r->display_name);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "lang_id", r->lang_id);
      ndr->depth--;
}

_PUBLIC_ size_t ndr_size_spoolss_FormInfo2(const struct spoolss_FormInfo2 *r, struct smb_iconv_convenience *ic, int flags)
{
      return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo2, ic);
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_FormInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            if (ndr_flags & NDR_SCALARS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_FormInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_push_align(ndr, 4));
                              NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_push_spoolss_FormInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  int level = ndr_push_get_switch_value(ndr, r);
                  NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_push_spoolss_FormInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_push_spoolss_FormInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_FormInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_FormInfo *r)
{
      uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr);
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_pull_get_switch_value(ndr, r);
            if (ndr_flags & NDR_SCALARS) {
                  switch (level) {
                        case 1: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_FormInfo1(ndr, NDR_SCALARS, &r->info1));
                        break; }

                        case 2: {
                              NDR_CHECK(ndr_pull_align(ndr, 4));
                              NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset));
                              NDR_CHECK(ndr_pull_spoolss_FormInfo2(ndr, NDR_SCALARS, &r->info2));
                        break; }

                        default: {
                        break; }

                  }
            }
            if (ndr_flags & NDR_BUFFERS) {
                  NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r));
                  switch (level) {
                        case 1:
                              NDR_CHECK(ndr_pull_spoolss_FormInfo1(ndr, NDR_BUFFERS, &r->info1));
                        break;

                        case 2:
                              NDR_CHECK(ndr_pull_spoolss_FormInfo2(ndr, NDR_BUFFERS, &r->info2));
                        break;

                        default:
                        break;

                  }
            }
            ndr->flags = _flags_save_UNION;
      }
      ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset);
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_FormInfo(struct ndr_print *ndr, const char *name, const union spoolss_FormInfo *r)
{
      int level;
      {
            uint32_t _flags_save_UNION = ndr->flags;
            ndr_set_flags(&ndr->flags, LIBNDR_FLAG_RELATIVE_REVERSE);
            level = ndr_print_get_switch_value(ndr, r);
            ndr_print_union(ndr, name, level, "spoolss_FormInfo");
            switch (level) {
                  case 1:
                        ndr_print_spoolss_FormInfo1(ndr, "info1", &r->info1);
                  break;

                  case 2:
                        ndr_print_spoolss_FormInfo2(ndr, "info2", &r->info2);
                  break;

                  default:
                  break;

            }
            ndr->flags = _flags_save_UNION;
      }
}

_PUBLIC_ size_t ndr_size_spoolss_FormInfo(const union spoolss_FormInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
{
      flags |= LIBNDR_FLAG_RELATIVE_REVERSE;
      return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo, ic);
}

static enum ndr_err_code ndr_push_spoolss_AddFormInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddFormInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_FormFlags(ndr, NDR_SCALARS, r->flags));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->form_name));
            NDR_CHECK(ndr_push_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_push_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->form_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->form_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->form_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->form_name, ndr_charset_length(r->form_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddFormInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddFormInfo1 *r)
{
      uint32_t _ptr_form_name;
      TALLOC_CTX *_mem_save_form_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_FormFlags(ndr, NDR_SCALARS, &r->flags));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_form_name));
            if (_ptr_form_name) {
                  NDR_PULL_ALLOC(ndr, r->form_name);
            } else {
                  r->form_name = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->form_name) {
                  _mem_save_form_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->form_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->form_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->form_name));
                  if (ndr_get_array_length(ndr, &r->form_name) > ndr_get_array_size(ndr, &r->form_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->form_name), ndr_get_array_length(ndr, &r->form_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->form_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->form_name, ndr_get_array_length(ndr, &r->form_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_form_name_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddFormInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_AddFormInfo1 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddFormInfo1");
      ndr->depth++;
      ndr_print_spoolss_FormFlags(ndr, "flags", r->flags);
      ndr_print_ptr(ndr, "form_name", r->form_name);
      ndr->depth++;
      if (r->form_name) {
            ndr_print_string(ndr, "form_name", r->form_name);
      }
      ndr->depth--;
      ndr_print_spoolss_FormSize(ndr, "size", &r->size);
      ndr_print_spoolss_FormArea(ndr, "area", &r->area);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddFormInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddFormInfo2 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            NDR_CHECK(ndr_push_spoolss_FormFlags(ndr, NDR_SCALARS, r->flags));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->form_name));
            NDR_CHECK(ndr_push_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_push_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->keyword));
            NDR_CHECK(ndr_push_spoolss_FormStringType(ndr, NDR_SCALARS, r->string_type));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->mui_dll));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ressource_id));
            NDR_CHECK(ndr_push_unique_ptr(ndr, r->display_name));
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lang_id));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->form_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->form_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->form_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->form_name, ndr_charset_length(r->form_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->keyword) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->keyword, CH_DOS)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->keyword, CH_DOS)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->keyword, ndr_charset_length(r->keyword, CH_DOS), sizeof(uint8_t), CH_DOS));
            }
            if (r->mui_dll) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->mui_dll, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->mui_dll, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->mui_dll, ndr_charset_length(r->mui_dll, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
            if (r->display_name) {
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->display_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
                  NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->display_name, CH_UTF16)));
                  NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->display_name, ndr_charset_length(r->display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddFormInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddFormInfo2 *r)
{
      uint32_t _ptr_form_name;
      TALLOC_CTX *_mem_save_form_name_0;
      uint32_t _ptr_keyword;
      TALLOC_CTX *_mem_save_keyword_0;
      uint32_t _ptr_mui_dll;
      TALLOC_CTX *_mem_save_mui_dll_0;
      uint32_t _ptr_display_name;
      TALLOC_CTX *_mem_save_display_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            NDR_CHECK(ndr_pull_spoolss_FormFlags(ndr, NDR_SCALARS, &r->flags));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_form_name));
            if (_ptr_form_name) {
                  NDR_PULL_ALLOC(ndr, r->form_name);
            } else {
                  r->form_name = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_FormSize(ndr, NDR_SCALARS, &r->size));
            NDR_CHECK(ndr_pull_spoolss_FormArea(ndr, NDR_SCALARS, &r->area));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyword));
            if (_ptr_keyword) {
                  NDR_PULL_ALLOC(ndr, r->keyword);
            } else {
                  r->keyword = NULL;
            }
            NDR_CHECK(ndr_pull_spoolss_FormStringType(ndr, NDR_SCALARS, &r->string_type));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mui_dll));
            if (_ptr_mui_dll) {
                  NDR_PULL_ALLOC(ndr, r->mui_dll);
            } else {
                  r->mui_dll = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ressource_id));
            NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name));
            if (_ptr_display_name) {
                  NDR_PULL_ALLOC(ndr, r->display_name);
            } else {
                  r->display_name = NULL;
            }
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lang_id));
      }
      if (ndr_flags & NDR_BUFFERS) {
            if (r->form_name) {
                  _mem_save_form_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->form_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->form_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->form_name));
                  if (ndr_get_array_length(ndr, &r->form_name) > ndr_get_array_size(ndr, &r->form_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->form_name), ndr_get_array_length(ndr, &r->form_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->form_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->form_name, ndr_get_array_length(ndr, &r->form_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_form_name_0, 0);
            }
            if (r->keyword) {
                  _mem_save_keyword_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->keyword, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->keyword));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->keyword));
                  if (ndr_get_array_length(ndr, &r->keyword) > ndr_get_array_size(ndr, &r->keyword)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->keyword), ndr_get_array_length(ndr, &r->keyword));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->keyword), sizeof(uint8_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->keyword, ndr_get_array_length(ndr, &r->keyword), sizeof(uint8_t), CH_DOS));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyword_0, 0);
            }
            if (r->mui_dll) {
                  _mem_save_mui_dll_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->mui_dll, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->mui_dll));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->mui_dll));
                  if (ndr_get_array_length(ndr, &r->mui_dll) > ndr_get_array_size(ndr, &r->mui_dll)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->mui_dll), ndr_get_array_length(ndr, &r->mui_dll));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->mui_dll), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->mui_dll, ndr_get_array_length(ndr, &r->mui_dll), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mui_dll_0, 0);
            }
            if (r->display_name) {
                  _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                  NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0);
                  NDR_CHECK(ndr_pull_array_size(ndr, &r->display_name));
                  NDR_CHECK(ndr_pull_array_length(ndr, &r->display_name));
                  if (ndr_get_array_length(ndr, &r->display_name) > ndr_get_array_size(ndr, &r->display_name)) {
                        return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->display_name), ndr_get_array_length(ndr, &r->display_name));
                  }
                  NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->display_name), sizeof(uint16_t)));
                  NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->display_name, ndr_get_array_length(ndr, &r->display_name), sizeof(uint16_t), CH_UTF16));
                  NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddFormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_AddFormInfo2 *r)
{
      ndr_print_struct(ndr, name, "spoolss_AddFormInfo2");
      ndr->depth++;
      ndr_print_spoolss_FormFlags(ndr, "flags", r->flags);
      ndr_print_ptr(ndr, "form_name", r->form_name);
      ndr->depth++;
      if (r->form_name) {
            ndr_print_string(ndr, "form_name", r->form_name);
      }
      ndr->depth--;
      ndr_print_spoolss_FormSize(ndr, "size", &r->size);
      ndr_print_spoolss_FormArea(ndr, "area", &r->area);
      ndr_print_ptr(ndr, "keyword", r->keyword);
      ndr->depth++;
      if (r->keyword) {
            ndr_print_string(ndr, "keyword", r->keyword);
      }
      ndr->depth--;
      ndr_print_spoolss_FormStringType(ndr, "string_type", r->string_type);
      ndr_print_ptr(ndr, "mui_dll", r->mui_dll);
      ndr->depth++;
      if (r->mui_dll) {
            ndr_print_string(ndr, "mui_dll", r->mui_dll);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "ressource_id", r->ressource_id);
      ndr_print_ptr(ndr, "display_name", r->display_name);
      ndr->depth++;
      if (r->display_name) {
            ndr_print_string(ndr, "display_name", r->display_name);
      }
      ndr->depth--;
      ndr_print_uint32(ndr, "lang_id", r->lang_id);
      ndr->depth--;
}

static enum ndr_err_code ndr_push_spoolss_AddFormInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_AddFormInfo *r)
{
      if (ndr_flags & NDR_SCALARS) {
            int level = ndr_push_get_switch_value(ndr, r);
            NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
            switch (level) {
                  case 1: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1));
                  break; }

                  case 2: {
                        NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2));
                  break; }

                  default:
                        return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            int level = ndr_push_get_switch_value(ndr, r);
            switch (level) {
                  case 1:
                        if (r->info1) {
                              NDR_CHECK(ndr_push_spoolss_AddFormInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              NDR_CHECK(ndr_push_spoolss_AddFormInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                        }
                  break;

                  default:
                        return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_spoolss_AddFormInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_AddFormInfo *r)
{
      int level;
      uint32_t _level;
      TALLOC_CTX *_mem_save_info1_0;
      TALLOC_CTX *_mem_save_info2_0;
      level = ndr_pull_get_switch_value(ndr, r);
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
            if (_level != level) {
                  return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
            }
            switch (level) {
                  case 1: {
                        uint32_t _ptr_info1;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1));
                        if (_ptr_info1) {
                              NDR_PULL_ALLOC(ndr, r->info1);
                        } else {
                              r->info1 = NULL;
                        }
                  break; }

                  case 2: {
                        uint32_t _ptr_info2;
                        NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2));
                        if (_ptr_info2) {
                              NDR_PULL_ALLOC(ndr, r->info2);
                        } else {
                              r->info2 = NULL;
                        }
                  break; }

                  default:
                        return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            switch (level) {
                  case 1:
                        if (r->info1) {
                              _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddFormInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0);
                        }
                  break;

                  case 2:
                        if (r->info2) {
                              _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr);
                              NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0);
                              NDR_CHECK(ndr_pull_spoolss_AddFormInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2));
                              NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0);
                        }
                  break;

                  default:
                        return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_AddFormInfo(struct ndr_print *ndr, const char *name, const union spoolss_AddFormInfo *r)
{
      int level;
      level = ndr_print_get_switch_value(ndr, r);
      ndr_print_union(ndr, name, level, "spoolss_AddFormInfo");
      switch (level) {
            case 1:
                  ndr_print_ptr(ndr, "info1", r->info1);
                  ndr->depth++;
                  if (r->info1) {
                        ndr_print_spoolss_AddFormInfo1(ndr, "info1", r->info1);
                  }
                  ndr->depth--;
            break;

            case 2:
                  ndr_print_ptr(ndr, "info2", r->info2);
                  ndr->depth++;
                  if (r->info2) {
                        ndr_print_spoolss_AddFormInfo2(ndr, "info2", r->info2);
                  }
                  ndr->depth--;
            break;

            default:
                  ndr_print_bad_level(ndr, name, level);
      }
}

_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PortInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo1 *r)
{
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_push_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_push_relative_ptr1(ndr, r->port_name));
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->port_name) {
                        NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->port_name));
                        NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->port_name));
                        NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->port_name));
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PortInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo1 *r)
{
      uint32_t _ptr_port_name;
      TALLOC_CTX *_mem_save_port_name_0;
      if (ndr_flags & NDR_SCALARS) {
            NDR_CHECK(ndr_pull_align(ndr, 4));
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_port_name));
                  if (_ptr_port_name) {
                        NDR_PULL_ALLOC(ndr, r->port_name);
                        NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->port_name, _ptr_port_name));
                  } else {
                        r->port_name = NULL;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      if (ndr_flags & NDR_BUFFERS) {
            {
                  uint32_t _flags_save_string = ndr->flags;
                  ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
                  if (r->port_name) {
                        uint32_t _relative_save_offset;
                        _relative_save_offset = ndr->offset;
                        NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->port_name));
                        _mem_save_port_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
                        NDR_PULL_SET_MEM_CTX(ndr, r->port_name, 0);
                        NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->port_name));
                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_port_name_0, 0);
                        ndr->offset = _relative_save_offset;
                  }
                  ndr->flags = _flags_save_string;
            }
      }
      return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_spoolss_PortInfo1(struct ndr_print *ndr, const char *name,