For some strange reason using :
[ira/wip.git] / librpc / gen_ndr / srv_spoolss.c
index 1f8c89a53ffebd109d534b1726e81df37992e858..ae99f098a617349a80e05d6606076d724eb174cf 100644 (file)
@@ -45,7 +45,13 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_PrinterInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_PrinterInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -370,7 +376,13 @@ static bool api_spoolss_EnumJobs(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_JobInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_JobInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -455,6 +467,13 @@ static bool api_spoolss_AddPrinter(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_AddPrinter, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.handle = talloc_zero(r, struct policy_handle);
+       if (r->out.handle == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_AddPrinter(p, r);
 
        if (p->rng_fault_state) {
@@ -834,7 +853,13 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_DriverInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_DriverInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -919,6 +944,19 @@ static bool api_spoolss_GetPrinterDriver(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriver, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.info = talloc_zero(r, union spoolss_DriverInfo);
+       if (r->out.info == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.needed = talloc_zero(r, uint32_t);
+       if (r->out.needed == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_GetPrinterDriver(p, r);
 
        if (p->rng_fault_state) {
@@ -1225,7 +1263,13 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_PrintProcessorInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_PrintProcessorInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -1310,6 +1354,19 @@ static bool api_spoolss_GetPrintProcessorDirectory(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_GetPrintProcessorDirectory, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.info = talloc_zero(r, union spoolss_PrintProcessorDirectoryInfo);
+       if (r->out.info == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.needed = talloc_zero(r, uint32_t);
+       if (r->out.needed == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_GetPrintProcessorDirectory(p, r);
 
        if (p->rng_fault_state) {
@@ -2076,12 +2133,18 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.type = talloc_zero(r, enum spoolss_PrinterDataType);
+       r->out.type = talloc_zero(r, enum winreg_Type);
        if (r->out.type == NULL) {
                talloc_free(r);
                return false;
        }
 
+       r->out.data = talloc_zero(r, union spoolss_PrinterData);
+       if (r->out.data == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.needed = talloc_zero(r, uint32_t);
        if (r->out.needed == NULL) {
                talloc_free(r);
@@ -2688,7 +2751,13 @@ static bool api_spoolss_EnumForms(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_FormInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_FormInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -2774,7 +2843,13 @@ static bool api_spoolss_EnumPorts(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_PortInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_PortInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -2860,7 +2935,13 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero_array(r, union spoolss_MonitorInfo, r->out.count);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_MonitorInfo *);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -3164,6 +3245,13 @@ static bool api_spoolss_CreatePrinterIC(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_CreatePrinterIC, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.gdi_handle = talloc_zero(r, struct policy_handle);
+       if (r->out.gdi_handle == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_CreatePrinterIC(p, r);
 
        if (p->rng_fault_state) {
@@ -3310,6 +3398,8 @@ static bool api_spoolss_DeletePrinterIC(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_DeletePrinterIC, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.gdi_handle = r->in.gdi_handle;
        r->out.result = _spoolss_DeletePrinterIC(p, r);
 
        if (p->rng_fault_state) {
@@ -3967,6 +4057,25 @@ static bool api_spoolss_EnumPrintProcDataTypes(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.info = talloc_zero(r, union spoolss_PrintProcDataTypesInfo *);
+       if (r->out.info == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.needed = talloc_zero(r, uint32_t);
+       if (r->out.needed == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_EnumPrintProcDataTypes(p, r);
 
        if (p->rng_fault_state) {
@@ -4114,7 +4223,7 @@ static bool api_spoolss_GetPrinterDriver2(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.info = talloc_zero(r, DATA_BLOB);
+       r->out.info = talloc_zero(r, union spoolss_DriverInfo);
        if (r->out.info == NULL) {
                talloc_free(r);
                return false;
@@ -5409,6 +5518,13 @@ static bool api_spoolss_AddPrinterEx(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_AddPrinterEx, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.handle = talloc_zero(r, struct policy_handle);
+       if (r->out.handle == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_AddPrinterEx(p, r);
 
        if (p->rng_fault_state) {
@@ -5568,14 +5684,14 @@ static bool api_spoolss_EnumPrinterData(pipes_struct *p)
                return false;
        }
 
-       r->out.printerdata_type = talloc_zero(r, uint32_t);
-       if (r->out.printerdata_type == NULL) {
+       r->out.type = talloc_zero(r, enum winreg_Type);
+       if (r->out.type == NULL) {
                talloc_free(r);
                return false;
        }
 
-       r->out.buffer = talloc_zero(r, DATA_BLOB);
-       if (r->out.buffer == NULL) {
+       r->out.data = talloc_zero_array(r, uint8_t, r->in.data_offered);
+       if (r->out.data == NULL) {
                talloc_free(r);
                return false;
        }
@@ -6025,7 +6141,7 @@ static bool api_spoolss_GetPrinterDataEx(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.type = talloc_zero(r, uint32_t);
+       r->out.type = talloc_zero(r, enum winreg_Type);
        if (r->out.type == NULL) {
                talloc_free(r);
                return false;
@@ -6117,20 +6233,20 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
-       if (r->out.buffer == NULL) {
+       r->out.count = talloc_zero(r, uint32_t);
+       if (r->out.count == NULL) {
                talloc_free(r);
                return false;
        }
 
-       r->out.needed = talloc_zero(r, uint32_t);
-       if (r->out.needed == NULL) {
+       r->out.info = talloc_zero(r, struct spoolss_PrinterEnumValues *);
+       if (r->out.info == NULL) {
                talloc_free(r);
                return false;
        }
 
-       r->out.count = talloc_zero(r, uint32_t);
-       if (r->out.count == NULL) {
+       r->out.needed = talloc_zero(r, uint32_t);
+       if (r->out.needed == NULL) {
                talloc_free(r);
                return false;
        }
@@ -6209,7 +6325,7 @@ static bool api_spoolss_EnumPrinterKey(pipes_struct *p)
        }
 
        ZERO_STRUCT(r->out);
-       r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2);
+       r->out.key_buffer = talloc_zero(r, const char **);
        if (r->out.key_buffer == NULL) {
                talloc_free(r);
                return false;
@@ -7484,7 +7600,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTERS: {
                        struct spoolss_EnumPrinters *r = (struct spoolss_EnumPrinters *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrinterInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7536,7 +7657,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMJOBS: {
                        struct spoolss_EnumJobs *r = (struct spoolss_EnumJobs *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_JobInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7552,6 +7678,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_ADDPRINTER: {
                        struct spoolss_AddPrinter *r = (struct spoolss_AddPrinter *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
+                       if (r->out.handle == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_AddPrinter(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7594,7 +7726,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTERDRIVERS: {
                        struct spoolss_EnumPrinterDrivers *r = (struct spoolss_EnumPrinterDrivers *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_DriverInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7610,6 +7747,17 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_GETPRINTERDRIVER: {
                        struct spoolss_GetPrinterDriver *r = (struct spoolss_GetPrinterDriver *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo);
+                       if (r->out.info == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.needed == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_GetPrinterDriver(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7646,7 +7794,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTPROCESSORS: {
                        struct spoolss_EnumPrintProcessors *r = (struct spoolss_EnumPrintProcessors *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrintProcessorInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7662,6 +7815,17 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY: {
                        struct spoolss_GetPrintProcessorDirectory *r = (struct spoolss_GetPrintProcessorDirectory *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorDirectoryInfo);
+                       if (r->out.info == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.needed == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_GetPrintProcessorDirectory(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7753,11 +7917,16 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_GETPRINTERDATA: {
                        struct spoolss_GetPrinterData *r = (struct spoolss_GetPrinterData *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.type = talloc_zero(mem_ctx, enum spoolss_PrinterDataType);
+                       r->out.type = talloc_zero(mem_ctx, enum winreg_Type);
                        if (r->out.type == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
+                       r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData);
+                       if (r->out.data == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
                        return NT_STATUS_NO_MEMORY;
@@ -7825,7 +7994,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMFORMS: {
                        struct spoolss_EnumForms *r = (struct spoolss_EnumForms *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_FormInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7842,7 +8016,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPORTS: {
                        struct spoolss_EnumPorts *r = (struct spoolss_EnumPorts *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_PortInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_PortInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7859,7 +8038,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMMONITORS: {
                        struct spoolss_EnumMonitors *r = (struct spoolss_EnumMonitors *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero_array(mem_ctx, union spoolss_MonitorInfo, r->out.count);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_MonitorInfo *);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -7893,6 +8077,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_CREATEPRINTERIC: {
                        struct spoolss_CreatePrinterIC *r = (struct spoolss_CreatePrinterIC *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
+                       if (r->out.gdi_handle == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_CreatePrinterIC(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7905,6 +8095,8 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_DELETEPRINTERIC: {
                        struct spoolss_DeletePrinterIC *r = (struct spoolss_DeletePrinterIC *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.gdi_handle = r->in.gdi_handle;
                        r->out.result = _spoolss_DeletePrinterIC(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7959,6 +8151,22 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_ENUMPRINTPROCDATATYPES: {
                        struct spoolss_EnumPrintProcDataTypes *r = (struct spoolss_EnumPrintProcDataTypes *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcDataTypesInfo *);
+                       if (r->out.info == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.needed == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_EnumPrintProcDataTypes(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7972,7 +8180,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_GETPRINTERDRIVER2: {
                        struct spoolss_GetPrinterDriver2 *r = (struct spoolss_GetPrinterDriver2 *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.info = talloc_zero(mem_ctx, DATA_BLOB);
+                       r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo);
                        if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -8120,6 +8328,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_ADDPRINTEREX: {
                        struct spoolss_AddPrinterEx *r = (struct spoolss_AddPrinterEx *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
+                       if (r->out.handle == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_AddPrinterEx(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -8143,13 +8357,13 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.printerdata_type = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.printerdata_type == NULL) {
+                       r->out.type = talloc_zero(mem_ctx, enum winreg_Type);
+                       if (r->out.type == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB);
-                       if (r->out.buffer == NULL) {
+                       r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_offered);
+                       if (r->out.data == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
@@ -8195,7 +8409,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_GETPRINTERDATAEX: {
                        struct spoolss_GetPrinterDataEx *r = (struct spoolss_GetPrinterDataEx *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.type = talloc_zero(mem_ctx, uint32_t);
+                       r->out.type = talloc_zero(mem_ctx, enum winreg_Type);
                        if (r->out.type == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
@@ -8217,18 +8431,18 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTERDATAEX: {
                        struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
-                       if (r->out.buffer == NULL) {
+                       r->out.count = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.count == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.needed == NULL) {
+                       r->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterEnumValues *);
+                       if (r->out.info == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.count = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.count == NULL) {
+                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.needed == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }
 
@@ -8239,7 +8453,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                case NDR_SPOOLSS_ENUMPRINTERKEY: {
                        struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r;
                        ZERO_STRUCT(r->out);
-                       r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2);
+                       r->out.key_buffer = talloc_zero(mem_ctx, const char **);
                        if (r->out.key_buffer == NULL) {
                        return NT_STATUS_NO_MEMORY;
                        }