spoolss: more mork on SetPrinterInfo() levels.
[ira/wip.git] / librpc / gen_ndr / ndr_spoolss.c
index 6178b1c93b29b543144792f6568ffac0b9379d8c..fb93aafcacf8bbe9db45cbb5b605fb93dc0228a1 100644 (file)
@@ -6781,12 +6781,12 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr,
                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_uint32(ndr, NDR_SCALARS, r->devmode_ptr));
                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_uint32(ndr, NDR_SCALARS, r->secdesc_ptr));
                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));
@@ -6840,14 +6840,6 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr,
                        NDR_CHECK(ndr_push_uint3264(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_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->sepfile, CH_UTF16)));
                        NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
@@ -6872,14 +6864,6 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo2(struct ndr_push *ndr,
                        NDR_CHECK(ndr_push_uint3264(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;
 }
@@ -6900,8 +6884,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr,
        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;
@@ -6910,8 +6892,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr,
        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, 5));
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername));
@@ -6956,12 +6936,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr,
                } 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_uint32(ndr, NDR_SCALARS, &r->devmode_ptr));
                NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sepfile));
                if (_ptr_sepfile) {
                        NDR_PULL_ALLOC(ndr, r->sepfile);
@@ -6986,12 +6961,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr,
                } 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_uint32(ndr, NDR_SCALARS, &r->secdesc_ptr));
                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) {
@@ -7090,17 +7060,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr,
                        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);
@@ -7149,17 +7108,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr,
                        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;
 }
@@ -7210,12 +7158,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo2(struct ndr_print *ndr, const cha
                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_uint32(ndr, "devmode_ptr", r->devmode_ptr);
        ndr_print_ptr(ndr, "sepfile", r->sepfile);
        ndr->depth++;
        if (r->sepfile) {
@@ -7240,12 +7183,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo2(struct ndr_print *ndr, const cha
                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_uint32(ndr, "secdesc_ptr", r->secdesc_ptr);
        ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes);
        ndr_print_uint32(ndr, "priority", r->priority);
        ndr_print_uint32(ndr, "defaultpriority", r->defaultpriority);
@@ -7588,6 +7526,70 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo7(struct ndr_print *ndr, const cha
        ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo8 *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devmode_ptr));
+               NDR_CHECK(ndr_push_trailer_align(ndr, 4));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo8 *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devmode_ptr));
+               NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo8 *r)
+{
+       ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo8");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "devmode_ptr", r->devmode_ptr);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo9(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetPrinterInfo9 *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->devmode_ptr));
+               NDR_CHECK(ndr_push_trailer_align(ndr, 4));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo9(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo9 *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->devmode_ptr));
+               NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_spoolss_SetPrinterInfo9(struct ndr_print *ndr, const char *name, const struct spoolss_SetPrinterInfo9 *r)
+{
+       ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo9");
+       ndr->depth++;
+       ndr_print_uint32(ndr, "devmode_ptr", r->devmode_ptr);
+       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) {
@@ -7693,13 +7695,13 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo(struct ndr_push *ndr, i
 
                        case 8:
                                if (r->info8) {
-                                       NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info8));
+                                       NDR_CHECK(ndr_push_spoolss_SetPrinterInfo8(ndr, NDR_SCALARS, r->info8));
                                }
                        break;
 
                        case 9:
                                if (r->info9) {
-                                       NDR_CHECK(ndr_push_spoolss_DeviceModeInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->info9));
+                                       NDR_CHECK(ndr_push_spoolss_SetPrinterInfo9(ndr, NDR_SCALARS, r->info9));
                                }
                        break;
 
@@ -7916,7 +7918,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo(struct ndr_pull *ndr, i
                                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_CHECK(ndr_pull_spoolss_SetPrinterInfo8(ndr, NDR_SCALARS, r->info8));
                                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info8_0, 0);
                                }
                        break;
@@ -7925,7 +7927,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo(struct ndr_pull *ndr, i
                                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_CHECK(ndr_pull_spoolss_SetPrinterInfo9(ndr, NDR_SCALARS, r->info9));
                                        NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info9_0, 0);
                                }
                        break;
@@ -8020,7 +8022,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo(struct ndr_print *ndr, const char
                        ndr_print_ptr(ndr, "info8", r->info8);
                        ndr->depth++;
                        if (r->info8) {
-                               ndr_print_spoolss_DeviceModeInfo(ndr, "info8", r->info8);
+                               ndr_print_spoolss_SetPrinterInfo8(ndr, "info8", r->info8);
                        }
                        ndr->depth--;
                break;
@@ -8029,7 +8031,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo(struct ndr_print *ndr, const char
                        ndr_print_ptr(ndr, "info9", r->info9);
                        ndr->depth++;
                        if (r->info9) {
-                               ndr_print_spoolss_DeviceModeInfo(ndr, "info9", r->info9);
+                               ndr_print_spoolss_SetPrinterInfo9(ndr, "info9", r->info9);
                        }
                        ndr->depth--;
                break;