s3: re-run make samba3-idl.
[kai/samba-autobuild/.git] / librpc / gen_ndr / srv_spoolss.c
index 64af1c4a1678ff1cb279345f22e67e2b9170ebb1..0ac29d408a4c5cbbda04cc9f0271d4902405da75 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) {
@@ -1921,6 +1978,14 @@ static bool api_spoolss_AddJob(pipes_struct *p)
                NDR_PRINT_IN_DEBUG(spoolss_AddJob, r);
        }
 
+       ZERO_STRUCT(r->out);
+       r->out.buffer = r->in.buffer;
+       r->out.needed = talloc_zero(r, uint32_t);
+       if (r->out.needed == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
        r->out.result = _spoolss_AddJob(p, r);
 
        if (p->rng_fault_state) {
@@ -2068,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_array(r, uint8_t, r->in.offered);
+       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);
@@ -2680,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;
@@ -2766,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;
@@ -2852,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;
@@ -3156,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) {
@@ -3302,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) {
@@ -3959,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) {
@@ -4106,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;
@@ -5050,18 +5167,18 @@ static bool api_spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p)
        return true;
 }
 
-static bool api_spoolss_RouterRefreshPrinterChangeNotification(pipes_struct *p)
+static bool api_spoolss_RouterReplyPrinterEx(pipes_struct *p)
 {
        const struct ndr_interface_call *call;
        struct ndr_pull *pull;
        struct ndr_push *push;
        enum ndr_err_code ndr_err;
        DATA_BLOB blob;
-       struct spoolss_RouterRefreshPrinterChangeNotification *r;
+       struct spoolss_RouterReplyPrinterEx *r;
 
-       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION];
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREPLYPRINTEREX];
 
-       r = talloc(talloc_tos(), struct spoolss_RouterRefreshPrinterChangeNotification);
+       r = talloc(talloc_tos(), struct spoolss_RouterReplyPrinterEx);
        if (r == NULL) {
                return false;
        }
@@ -5085,10 +5202,17 @@ static bool api_spoolss_RouterRefreshPrinterChangeNotification(pipes_struct *p)
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, r);
+               NDR_PRINT_IN_DEBUG(spoolss_RouterReplyPrinterEx, r);
+       }
+
+       ZERO_STRUCT(r->out);
+       r->out.reply_result = talloc_zero(r, uint32_t);
+       if (r->out.reply_result == NULL) {
+               talloc_free(r);
+               return false;
        }
 
-       r->out.result = _spoolss_RouterRefreshPrinterChangeNotification(p, r);
+       r->out.result = _spoolss_RouterReplyPrinterEx(p, r);
 
        if (p->rng_fault_state) {
                talloc_free(r);
@@ -5097,7 +5221,7 @@ static bool api_spoolss_RouterRefreshPrinterChangeNotification(pipes_struct *p)
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotification, r);
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterReplyPrinterEx, r);
        }
 
        push = ndr_push_init_ctx(r, NULL);
@@ -5123,18 +5247,18 @@ static bool api_spoolss_RouterRefreshPrinterChangeNotification(pipes_struct *p)
        return true;
 }
 
-static bool api_spoolss_RemoteFindNextPrinterChangeNotifyEx(pipes_struct *p)
+static bool api_spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p)
 {
        const struct ndr_interface_call *call;
        struct ndr_pull *pull;
        struct ndr_push *push;
        enum ndr_err_code ndr_err;
        DATA_BLOB blob;
-       struct spoolss_RemoteFindNextPrinterChangeNotifyEx *r;
+       struct spoolss_RouterRefreshPrinterChangeNotify *r;
 
-       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX];
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY];
 
-       r = talloc(talloc_tos(), struct spoolss_RemoteFindNextPrinterChangeNotifyEx);
+       r = talloc(talloc_tos(), struct spoolss_RouterRefreshPrinterChangeNotify);
        if (r == NULL) {
                return false;
        }
@@ -5158,7 +5282,7 @@ static bool api_spoolss_RemoteFindNextPrinterChangeNotifyEx(pipes_struct *p)
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_IN_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, r);
+               NDR_PRINT_IN_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, r);
        }
 
        ZERO_STRUCT(r->out);
@@ -5168,7 +5292,7 @@ static bool api_spoolss_RemoteFindNextPrinterChangeNotifyEx(pipes_struct *p)
                return false;
        }
 
-       r->out.result = _spoolss_RemoteFindNextPrinterChangeNotifyEx(p, r);
+       r->out.result = _spoolss_RouterRefreshPrinterChangeNotify(p, r);
 
        if (p->rng_fault_state) {
                talloc_free(r);
@@ -5177,7 +5301,7 @@ static bool api_spoolss_RemoteFindNextPrinterChangeNotifyEx(pipes_struct *p)
        }
 
        if (DEBUGLEVEL >= 10) {
-               NDR_PRINT_OUT_DEBUG(spoolss_RemoteFindNextPrinterChangeNotifyEx, r);
+               NDR_PRINT_OUT_DEBUG(spoolss_RouterRefreshPrinterChangeNotify, r);
        }
 
        push = ndr_push_init_ctx(r, NULL);
@@ -5394,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) {
@@ -5553,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;
        }
@@ -6010,14 +6141,14 @@ 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;
        }
 
-       r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
-       if (r->out.buffer == NULL) {
+       r->out.data = talloc_zero_array(r, uint8_t, r->in.offered);
+       if (r->out.data == NULL) {
                talloc_free(r);
                return false;
        }
@@ -6102,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;
        }
@@ -6194,7 +6325,13 @@ 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._ndr_size = talloc_zero(r, uint32_t);
+       if (r->out._ndr_size == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.key_buffer = talloc_zero(r, union spoolss_KeyNames);
        if (r->out.key_buffer == NULL) {
                talloc_free(r);
                return false;
@@ -7350,133 +7487,1189 @@ static bool api_spoolss_5f(pipes_struct *p)
        return true;
 }
 
-
-/* Tables */
-static struct api_struct api_spoolss_cmds[] = 
+static bool api_spoolss_60(pipes_struct *p)
 {
-       {"SPOOLSS_ENUMPRINTERS", NDR_SPOOLSS_ENUMPRINTERS, api_spoolss_EnumPrinters},
-       {"SPOOLSS_OPENPRINTER", NDR_SPOOLSS_OPENPRINTER, api_spoolss_OpenPrinter},
-       {"SPOOLSS_SETJOB", NDR_SPOOLSS_SETJOB, api_spoolss_SetJob},
-       {"SPOOLSS_GETJOB", NDR_SPOOLSS_GETJOB, api_spoolss_GetJob},
-       {"SPOOLSS_ENUMJOBS", NDR_SPOOLSS_ENUMJOBS, api_spoolss_EnumJobs},
-       {"SPOOLSS_ADDPRINTER", NDR_SPOOLSS_ADDPRINTER, api_spoolss_AddPrinter},
-       {"SPOOLSS_DELETEPRINTER", NDR_SPOOLSS_DELETEPRINTER, api_spoolss_DeletePrinter},
-       {"SPOOLSS_SETPRINTER", NDR_SPOOLSS_SETPRINTER, api_spoolss_SetPrinter},
-       {"SPOOLSS_GETPRINTER", NDR_SPOOLSS_GETPRINTER, api_spoolss_GetPrinter},
-       {"SPOOLSS_ADDPRINTERDRIVER", NDR_SPOOLSS_ADDPRINTERDRIVER, api_spoolss_AddPrinterDriver},
-       {"SPOOLSS_ENUMPRINTERDRIVERS", NDR_SPOOLSS_ENUMPRINTERDRIVERS, api_spoolss_EnumPrinterDrivers},
-       {"SPOOLSS_GETPRINTERDRIVER", NDR_SPOOLSS_GETPRINTERDRIVER, api_spoolss_GetPrinterDriver},
-       {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_GetPrinterDriverDirectory},
-       {"SPOOLSS_DELETEPRINTERDRIVER", NDR_SPOOLSS_DELETEPRINTERDRIVER, api_spoolss_DeletePrinterDriver},
-       {"SPOOLSS_ADDPRINTPROCESSOR", NDR_SPOOLSS_ADDPRINTPROCESSOR, api_spoolss_AddPrintProcessor},
-       {"SPOOLSS_ENUMPRINTPROCESSORS", NDR_SPOOLSS_ENUMPRINTPROCESSORS, api_spoolss_EnumPrintProcessors},
-       {"SPOOLSS_GETPRINTPROCESSORDIRECTORY", NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY, api_spoolss_GetPrintProcessorDirectory},
-       {"SPOOLSS_STARTDOCPRINTER", NDR_SPOOLSS_STARTDOCPRINTER, api_spoolss_StartDocPrinter},
-       {"SPOOLSS_STARTPAGEPRINTER", NDR_SPOOLSS_STARTPAGEPRINTER, api_spoolss_StartPagePrinter},
-       {"SPOOLSS_WRITEPRINTER", NDR_SPOOLSS_WRITEPRINTER, api_spoolss_WritePrinter},
-       {"SPOOLSS_ENDPAGEPRINTER", NDR_SPOOLSS_ENDPAGEPRINTER, api_spoolss_EndPagePrinter},
-       {"SPOOLSS_ABORTPRINTER", NDR_SPOOLSS_ABORTPRINTER, api_spoolss_AbortPrinter},
-       {"SPOOLSS_READPRINTER", NDR_SPOOLSS_READPRINTER, api_spoolss_ReadPrinter},
-       {"SPOOLSS_ENDDOCPRINTER", NDR_SPOOLSS_ENDDOCPRINTER, api_spoolss_EndDocPrinter},
-       {"SPOOLSS_ADDJOB", NDR_SPOOLSS_ADDJOB, api_spoolss_AddJob},
-       {"SPOOLSS_SCHEDULEJOB", NDR_SPOOLSS_SCHEDULEJOB, api_spoolss_ScheduleJob},
-       {"SPOOLSS_GETPRINTERDATA", NDR_SPOOLSS_GETPRINTERDATA, api_spoolss_GetPrinterData},
-       {"SPOOLSS_SETPRINTERDATA", NDR_SPOOLSS_SETPRINTERDATA, api_spoolss_SetPrinterData},
-       {"SPOOLSS_WAITFORPRINTERCHANGE", NDR_SPOOLSS_WAITFORPRINTERCHANGE, api_spoolss_WaitForPrinterChange},
-       {"SPOOLSS_CLOSEPRINTER", NDR_SPOOLSS_CLOSEPRINTER, api_spoolss_ClosePrinter},
-       {"SPOOLSS_ADDFORM", NDR_SPOOLSS_ADDFORM, api_spoolss_AddForm},
-       {"SPOOLSS_DELETEFORM", NDR_SPOOLSS_DELETEFORM, api_spoolss_DeleteForm},
-       {"SPOOLSS_GETFORM", NDR_SPOOLSS_GETFORM, api_spoolss_GetForm},
-       {"SPOOLSS_SETFORM", NDR_SPOOLSS_SETFORM, api_spoolss_SetForm},
-       {"SPOOLSS_ENUMFORMS", NDR_SPOOLSS_ENUMFORMS, api_spoolss_EnumForms},
-       {"SPOOLSS_ENUMPORTS", NDR_SPOOLSS_ENUMPORTS, api_spoolss_EnumPorts},
-       {"SPOOLSS_ENUMMONITORS", NDR_SPOOLSS_ENUMMONITORS, api_spoolss_EnumMonitors},
-       {"SPOOLSS_ADDPORT", NDR_SPOOLSS_ADDPORT, api_spoolss_AddPort},
-       {"SPOOLSS_CONFIGUREPORT", NDR_SPOOLSS_CONFIGUREPORT, api_spoolss_ConfigurePort},
-       {"SPOOLSS_DELETEPORT", NDR_SPOOLSS_DELETEPORT, api_spoolss_DeletePort},
-       {"SPOOLSS_CREATEPRINTERIC", NDR_SPOOLSS_CREATEPRINTERIC, api_spoolss_CreatePrinterIC},
-       {"SPOOLSS_PLAYGDISCRIPTONPRINTERIC", NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC, api_spoolss_PlayGDIScriptOnPrinterIC},
-       {"SPOOLSS_DELETEPRINTERIC", NDR_SPOOLSS_DELETEPRINTERIC, api_spoolss_DeletePrinterIC},
-       {"SPOOLSS_ADDPRINTERCONNECTION", NDR_SPOOLSS_ADDPRINTERCONNECTION, api_spoolss_AddPrinterConnection},
-       {"SPOOLSS_DELETEPRINTERCONNECTION", NDR_SPOOLSS_DELETEPRINTERCONNECTION, api_spoolss_DeletePrinterConnection},
-       {"SPOOLSS_PRINTERMESSAGEBOX", NDR_SPOOLSS_PRINTERMESSAGEBOX, api_spoolss_PrinterMessageBox},
-       {"SPOOLSS_ADDMONITOR", NDR_SPOOLSS_ADDMONITOR, api_spoolss_AddMonitor},
-       {"SPOOLSS_DELETEMONITOR", NDR_SPOOLSS_DELETEMONITOR, api_spoolss_DeleteMonitor},
-       {"SPOOLSS_DELETEPRINTPROCESSOR", NDR_SPOOLSS_DELETEPRINTPROCESSOR, api_spoolss_DeletePrintProcessor},
-       {"SPOOLSS_ADDPRINTPROVIDOR", NDR_SPOOLSS_ADDPRINTPROVIDOR, api_spoolss_AddPrintProvidor},
-       {"SPOOLSS_DELETEPRINTPROVIDOR", NDR_SPOOLSS_DELETEPRINTPROVIDOR, api_spoolss_DeletePrintProvidor},
-       {"SPOOLSS_ENUMPRINTPROCDATATYPES", NDR_SPOOLSS_ENUMPRINTPROCDATATYPES, api_spoolss_EnumPrintProcDataTypes},
-       {"SPOOLSS_RESETPRINTER", NDR_SPOOLSS_RESETPRINTER, api_spoolss_ResetPrinter},
-       {"SPOOLSS_GETPRINTERDRIVER2", NDR_SPOOLSS_GETPRINTERDRIVER2, api_spoolss_GetPrinterDriver2},
-       {"SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_FindFirstPrinterChangeNotification},
-       {"SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION, api_spoolss_FindNextPrinterChangeNotification},
-       {"SPOOLSS_FINDCLOSEPRINTERNOTIFY", NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY, api_spoolss_FindClosePrinterNotify},
-       {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD, api_spoolss_RouterFindFirstPrinterChangeNotificationOld},
-       {"SPOOLSS_REPLYOPENPRINTER", NDR_SPOOLSS_REPLYOPENPRINTER, api_spoolss_ReplyOpenPrinter},
-       {"SPOOLSS_ROUTERREPLYPRINTER", NDR_SPOOLSS_ROUTERREPLYPRINTER, api_spoolss_RouterReplyPrinter},
-       {"SPOOLSS_REPLYCLOSEPRINTER", NDR_SPOOLSS_REPLYCLOSEPRINTER, api_spoolss_ReplyClosePrinter},
-       {"SPOOLSS_ADDPORTEX", NDR_SPOOLSS_ADDPORTEX, api_spoolss_AddPortEx},
-       {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_RouterFindFirstPrinterChangeNotification},
-       {"SPOOLSS_SPOOLERINIT", NDR_SPOOLSS_SPOOLERINIT, api_spoolss_SpoolerInit},
-       {"SPOOLSS_RESETPRINTEREX", NDR_SPOOLSS_RESETPRINTEREX, api_spoolss_ResetPrinterEx},
-       {"SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX", NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, api_spoolss_RemoteFindFirstPrinterChangeNotifyEx},
-       {"SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION, api_spoolss_RouterRefreshPrinterChangeNotification},
-       {"SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX", NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX, api_spoolss_RemoteFindNextPrinterChangeNotifyEx},
-       {"SPOOLSS_44", NDR_SPOOLSS_44, api_spoolss_44},
-       {"SPOOLSS_OPENPRINTEREX", NDR_SPOOLSS_OPENPRINTEREX, api_spoolss_OpenPrinterEx},
-       {"SPOOLSS_ADDPRINTEREX", NDR_SPOOLSS_ADDPRINTEREX, api_spoolss_AddPrinterEx},
-       {"SPOOLSS_47", NDR_SPOOLSS_47, api_spoolss_47},
-       {"SPOOLSS_ENUMPRINTERDATA", NDR_SPOOLSS_ENUMPRINTERDATA, api_spoolss_EnumPrinterData},
-       {"SPOOLSS_DELETEPRINTERDATA", NDR_SPOOLSS_DELETEPRINTERDATA, api_spoolss_DeletePrinterData},
-       {"SPOOLSS_4A", NDR_SPOOLSS_4A, api_spoolss_4a},
-       {"SPOOLSS_4B", NDR_SPOOLSS_4B, api_spoolss_4b},
-       {"SPOOLSS_4C", NDR_SPOOLSS_4C, api_spoolss_4c},
-       {"SPOOLSS_SETPRINTERDATAEX", NDR_SPOOLSS_SETPRINTERDATAEX, api_spoolss_SetPrinterDataEx},
-       {"SPOOLSS_GETPRINTERDATAEX", NDR_SPOOLSS_GETPRINTERDATAEX, api_spoolss_GetPrinterDataEx},
-       {"SPOOLSS_ENUMPRINTERDATAEX", NDR_SPOOLSS_ENUMPRINTERDATAEX, api_spoolss_EnumPrinterDataEx},
-       {"SPOOLSS_ENUMPRINTERKEY", NDR_SPOOLSS_ENUMPRINTERKEY, api_spoolss_EnumPrinterKey},
-       {"SPOOLSS_DELETEPRINTERDATAEX", NDR_SPOOLSS_DELETEPRINTERDATAEX, api_spoolss_DeletePrinterDataEx},
-       {"SPOOLSS_DELETEPRINTERKEY", NDR_SPOOLSS_DELETEPRINTERKEY, api_spoolss_DeletePrinterKey},
-       {"SPOOLSS_53", NDR_SPOOLSS_53, api_spoolss_53},
-       {"SPOOLSS_DELETEPRINTERDRIVEREX", NDR_SPOOLSS_DELETEPRINTERDRIVEREX, api_spoolss_DeletePrinterDriverEx},
-       {"SPOOLSS_55", NDR_SPOOLSS_55, api_spoolss_55},
-       {"SPOOLSS_56", NDR_SPOOLSS_56, api_spoolss_56},
-       {"SPOOLSS_57", NDR_SPOOLSS_57, api_spoolss_57},
-       {"SPOOLSS_XCVDATA", NDR_SPOOLSS_XCVDATA, api_spoolss_XcvData},
-       {"SPOOLSS_ADDPRINTERDRIVEREX", NDR_SPOOLSS_ADDPRINTERDRIVEREX, api_spoolss_AddPrinterDriverEx},
-       {"SPOOLSS_5A", NDR_SPOOLSS_5A, api_spoolss_5a},
-       {"SPOOLSS_5B", NDR_SPOOLSS_5B, api_spoolss_5b},
-       {"SPOOLSS_5C", NDR_SPOOLSS_5C, api_spoolss_5c},
-       {"SPOOLSS_5D", NDR_SPOOLSS_5D, api_spoolss_5d},
-       {"SPOOLSS_5E", NDR_SPOOLSS_5E, api_spoolss_5e},
-       {"SPOOLSS_5F", NDR_SPOOLSS_5F, api_spoolss_5f},
-};
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_60 *r;
 
-void spoolss_get_pipe_fns(struct api_struct **fns, int *n_fns)
-{
-       *fns = api_spoolss_cmds;
-       *n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
-}
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_60];
 
-NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
-{
-       if (cli->pipes_struct == NULL) {
-               return NT_STATUS_INVALID_PARAMETER;
+       r = talloc(talloc_tos(), struct spoolss_60);
+       if (r == NULL) {
+               return false;
        }
 
-       switch (opnum)
-       {
-               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);
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_60, r);
+       }
+
+       r->out.result = _spoolss_60(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_60, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_61(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_61 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_61];
+
+       r = talloc(talloc_tos(), struct spoolss_61);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_61, r);
+       }
+
+       r->out.result = _spoolss_61(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_61, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_62(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_62 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_62];
+
+       r = talloc(talloc_tos(), struct spoolss_62);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_62, r);
+       }
+
+       r->out.result = _spoolss_62(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_62, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_63(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_63 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_63];
+
+       r = talloc(talloc_tos(), struct spoolss_63);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_63, r);
+       }
+
+       r->out.result = _spoolss_63(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_63, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_64(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_64 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_64];
+
+       r = talloc(talloc_tos(), struct spoolss_64);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_64, r);
+       }
+
+       r->out.result = _spoolss_64(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_64, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_65(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_65 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_65];
+
+       r = talloc(talloc_tos(), struct spoolss_65);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_65, r);
+       }
+
+       r->out.result = _spoolss_65(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_65, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_GetCorePrinterDrivers(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_GetCorePrinterDrivers *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETCOREPRINTERDRIVERS];
+
+       r = talloc(talloc_tos(), struct spoolss_GetCorePrinterDrivers);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetCorePrinterDrivers, r);
+       }
+
+       ZERO_STRUCT(r->out);
+       r->out.core_printer_drivers = talloc_zero_array(r, struct spoolss_CorePrinterDriver, r->in.core_printer_driver_count);
+       if (r->out.core_printer_drivers == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.result = _spoolss_GetCorePrinterDrivers(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetCorePrinterDrivers, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_67(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_67 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_67];
+
+       r = talloc(talloc_tos(), struct spoolss_67);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_67, r);
+       }
+
+       r->out.result = _spoolss_67(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_67, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_GetPrinterDriverPackagePath(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_GetPrinterDriverPackagePath *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH];
+
+       r = talloc(talloc_tos(), struct spoolss_GetPrinterDriverPackagePath);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_GetPrinterDriverPackagePath, r);
+       }
+
+       ZERO_STRUCT(r->out);
+       r->out.driver_package_cab = r->in.driver_package_cab;
+       r->out.required = talloc_zero(r, uint32_t);
+       if (r->out.required == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       r->out.result = _spoolss_GetPrinterDriverPackagePath(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_GetPrinterDriverPackagePath, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_69(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_69 *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_69];
+
+       r = talloc(talloc_tos(), struct spoolss_69);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_69, r);
+       }
+
+       r->out.result = _spoolss_69(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_69, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_6a(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_6a *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_6A];
+
+       r = talloc(talloc_tos(), struct spoolss_6a);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_6a, r);
+       }
+
+       r->out.result = _spoolss_6a(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_6a, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_6b(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_6b *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_6B];
+
+       r = talloc(talloc_tos(), struct spoolss_6b);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_6b, r);
+       }
+
+       r->out.result = _spoolss_6b(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_6b, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_6c(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_6c *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_6C];
+
+       r = talloc(talloc_tos(), struct spoolss_6c);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_6c, r);
+       }
+
+       r->out.result = _spoolss_6c(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_6c, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+static bool api_spoolss_6d(pipes_struct *p)
+{
+       const struct ndr_interface_call *call;
+       struct ndr_pull *pull;
+       struct ndr_push *push;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+       struct spoolss_6d *r;
+
+       call = &ndr_table_spoolss.calls[NDR_SPOOLSS_6D];
+
+       r = talloc(talloc_tos(), struct spoolss_6d);
+       if (r == NULL) {
+               return false;
+       }
+
+       if (!prs_data_blob(&p->in_data.data, &blob, r)) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull = ndr_pull_init_blob(&blob, r, NULL);
+       if (pull == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+       ndr_err = call->ndr_pull(pull, NDR_IN, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(spoolss_6d, r);
+       }
+
+       r->out.result = _spoolss_6d(p, r);
+
+       if (p->rng_fault_state) {
+               talloc_free(r);
+               /* Return true here, srv_pipe_hnd.c will take care */
+               return true;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(spoolss_6d, r);
+       }
+
+       push = ndr_push_init_ctx(r, NULL);
+       if (push == NULL) {
+               talloc_free(r);
+               return false;
+       }
+
+       ndr_err = call->ndr_push(push, NDR_OUT, r);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               talloc_free(r);
+               return false;
+       }
+
+       blob = ndr_push_blob(push);
+       if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
+               talloc_free(r);
+               return false;
+       }
+
+       talloc_free(r);
+
+       return true;
+}
+
+
+/* Tables */
+static struct api_struct api_spoolss_cmds[] = 
+{
+       {"SPOOLSS_ENUMPRINTERS", NDR_SPOOLSS_ENUMPRINTERS, api_spoolss_EnumPrinters},
+       {"SPOOLSS_OPENPRINTER", NDR_SPOOLSS_OPENPRINTER, api_spoolss_OpenPrinter},
+       {"SPOOLSS_SETJOB", NDR_SPOOLSS_SETJOB, api_spoolss_SetJob},
+       {"SPOOLSS_GETJOB", NDR_SPOOLSS_GETJOB, api_spoolss_GetJob},
+       {"SPOOLSS_ENUMJOBS", NDR_SPOOLSS_ENUMJOBS, api_spoolss_EnumJobs},
+       {"SPOOLSS_ADDPRINTER", NDR_SPOOLSS_ADDPRINTER, api_spoolss_AddPrinter},
+       {"SPOOLSS_DELETEPRINTER", NDR_SPOOLSS_DELETEPRINTER, api_spoolss_DeletePrinter},
+       {"SPOOLSS_SETPRINTER", NDR_SPOOLSS_SETPRINTER, api_spoolss_SetPrinter},
+       {"SPOOLSS_GETPRINTER", NDR_SPOOLSS_GETPRINTER, api_spoolss_GetPrinter},
+       {"SPOOLSS_ADDPRINTERDRIVER", NDR_SPOOLSS_ADDPRINTERDRIVER, api_spoolss_AddPrinterDriver},
+       {"SPOOLSS_ENUMPRINTERDRIVERS", NDR_SPOOLSS_ENUMPRINTERDRIVERS, api_spoolss_EnumPrinterDrivers},
+       {"SPOOLSS_GETPRINTERDRIVER", NDR_SPOOLSS_GETPRINTERDRIVER, api_spoolss_GetPrinterDriver},
+       {"SPOOLSS_GETPRINTERDRIVERDIRECTORY", NDR_SPOOLSS_GETPRINTERDRIVERDIRECTORY, api_spoolss_GetPrinterDriverDirectory},
+       {"SPOOLSS_DELETEPRINTERDRIVER", NDR_SPOOLSS_DELETEPRINTERDRIVER, api_spoolss_DeletePrinterDriver},
+       {"SPOOLSS_ADDPRINTPROCESSOR", NDR_SPOOLSS_ADDPRINTPROCESSOR, api_spoolss_AddPrintProcessor},
+       {"SPOOLSS_ENUMPRINTPROCESSORS", NDR_SPOOLSS_ENUMPRINTPROCESSORS, api_spoolss_EnumPrintProcessors},
+       {"SPOOLSS_GETPRINTPROCESSORDIRECTORY", NDR_SPOOLSS_GETPRINTPROCESSORDIRECTORY, api_spoolss_GetPrintProcessorDirectory},
+       {"SPOOLSS_STARTDOCPRINTER", NDR_SPOOLSS_STARTDOCPRINTER, api_spoolss_StartDocPrinter},
+       {"SPOOLSS_STARTPAGEPRINTER", NDR_SPOOLSS_STARTPAGEPRINTER, api_spoolss_StartPagePrinter},
+       {"SPOOLSS_WRITEPRINTER", NDR_SPOOLSS_WRITEPRINTER, api_spoolss_WritePrinter},
+       {"SPOOLSS_ENDPAGEPRINTER", NDR_SPOOLSS_ENDPAGEPRINTER, api_spoolss_EndPagePrinter},
+       {"SPOOLSS_ABORTPRINTER", NDR_SPOOLSS_ABORTPRINTER, api_spoolss_AbortPrinter},
+       {"SPOOLSS_READPRINTER", NDR_SPOOLSS_READPRINTER, api_spoolss_ReadPrinter},
+       {"SPOOLSS_ENDDOCPRINTER", NDR_SPOOLSS_ENDDOCPRINTER, api_spoolss_EndDocPrinter},
+       {"SPOOLSS_ADDJOB", NDR_SPOOLSS_ADDJOB, api_spoolss_AddJob},
+       {"SPOOLSS_SCHEDULEJOB", NDR_SPOOLSS_SCHEDULEJOB, api_spoolss_ScheduleJob},
+       {"SPOOLSS_GETPRINTERDATA", NDR_SPOOLSS_GETPRINTERDATA, api_spoolss_GetPrinterData},
+       {"SPOOLSS_SETPRINTERDATA", NDR_SPOOLSS_SETPRINTERDATA, api_spoolss_SetPrinterData},
+       {"SPOOLSS_WAITFORPRINTERCHANGE", NDR_SPOOLSS_WAITFORPRINTERCHANGE, api_spoolss_WaitForPrinterChange},
+       {"SPOOLSS_CLOSEPRINTER", NDR_SPOOLSS_CLOSEPRINTER, api_spoolss_ClosePrinter},
+       {"SPOOLSS_ADDFORM", NDR_SPOOLSS_ADDFORM, api_spoolss_AddForm},
+       {"SPOOLSS_DELETEFORM", NDR_SPOOLSS_DELETEFORM, api_spoolss_DeleteForm},
+       {"SPOOLSS_GETFORM", NDR_SPOOLSS_GETFORM, api_spoolss_GetForm},
+       {"SPOOLSS_SETFORM", NDR_SPOOLSS_SETFORM, api_spoolss_SetForm},
+       {"SPOOLSS_ENUMFORMS", NDR_SPOOLSS_ENUMFORMS, api_spoolss_EnumForms},
+       {"SPOOLSS_ENUMPORTS", NDR_SPOOLSS_ENUMPORTS, api_spoolss_EnumPorts},
+       {"SPOOLSS_ENUMMONITORS", NDR_SPOOLSS_ENUMMONITORS, api_spoolss_EnumMonitors},
+       {"SPOOLSS_ADDPORT", NDR_SPOOLSS_ADDPORT, api_spoolss_AddPort},
+       {"SPOOLSS_CONFIGUREPORT", NDR_SPOOLSS_CONFIGUREPORT, api_spoolss_ConfigurePort},
+       {"SPOOLSS_DELETEPORT", NDR_SPOOLSS_DELETEPORT, api_spoolss_DeletePort},
+       {"SPOOLSS_CREATEPRINTERIC", NDR_SPOOLSS_CREATEPRINTERIC, api_spoolss_CreatePrinterIC},
+       {"SPOOLSS_PLAYGDISCRIPTONPRINTERIC", NDR_SPOOLSS_PLAYGDISCRIPTONPRINTERIC, api_spoolss_PlayGDIScriptOnPrinterIC},
+       {"SPOOLSS_DELETEPRINTERIC", NDR_SPOOLSS_DELETEPRINTERIC, api_spoolss_DeletePrinterIC},
+       {"SPOOLSS_ADDPRINTERCONNECTION", NDR_SPOOLSS_ADDPRINTERCONNECTION, api_spoolss_AddPrinterConnection},
+       {"SPOOLSS_DELETEPRINTERCONNECTION", NDR_SPOOLSS_DELETEPRINTERCONNECTION, api_spoolss_DeletePrinterConnection},
+       {"SPOOLSS_PRINTERMESSAGEBOX", NDR_SPOOLSS_PRINTERMESSAGEBOX, api_spoolss_PrinterMessageBox},
+       {"SPOOLSS_ADDMONITOR", NDR_SPOOLSS_ADDMONITOR, api_spoolss_AddMonitor},
+       {"SPOOLSS_DELETEMONITOR", NDR_SPOOLSS_DELETEMONITOR, api_spoolss_DeleteMonitor},
+       {"SPOOLSS_DELETEPRINTPROCESSOR", NDR_SPOOLSS_DELETEPRINTPROCESSOR, api_spoolss_DeletePrintProcessor},
+       {"SPOOLSS_ADDPRINTPROVIDOR", NDR_SPOOLSS_ADDPRINTPROVIDOR, api_spoolss_AddPrintProvidor},
+       {"SPOOLSS_DELETEPRINTPROVIDOR", NDR_SPOOLSS_DELETEPRINTPROVIDOR, api_spoolss_DeletePrintProvidor},
+       {"SPOOLSS_ENUMPRINTPROCDATATYPES", NDR_SPOOLSS_ENUMPRINTPROCDATATYPES, api_spoolss_EnumPrintProcDataTypes},
+       {"SPOOLSS_RESETPRINTER", NDR_SPOOLSS_RESETPRINTER, api_spoolss_ResetPrinter},
+       {"SPOOLSS_GETPRINTERDRIVER2", NDR_SPOOLSS_GETPRINTERDRIVER2, api_spoolss_GetPrinterDriver2},
+       {"SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_FindFirstPrinterChangeNotification},
+       {"SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_FINDNEXTPRINTERCHANGENOTIFICATION, api_spoolss_FindNextPrinterChangeNotification},
+       {"SPOOLSS_FINDCLOSEPRINTERNOTIFY", NDR_SPOOLSS_FINDCLOSEPRINTERNOTIFY, api_spoolss_FindClosePrinterNotify},
+       {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATIONOLD, api_spoolss_RouterFindFirstPrinterChangeNotificationOld},
+       {"SPOOLSS_REPLYOPENPRINTER", NDR_SPOOLSS_REPLYOPENPRINTER, api_spoolss_ReplyOpenPrinter},
+       {"SPOOLSS_ROUTERREPLYPRINTER", NDR_SPOOLSS_ROUTERREPLYPRINTER, api_spoolss_RouterReplyPrinter},
+       {"SPOOLSS_REPLYCLOSEPRINTER", NDR_SPOOLSS_REPLYCLOSEPRINTER, api_spoolss_ReplyClosePrinter},
+       {"SPOOLSS_ADDPORTEX", NDR_SPOOLSS_ADDPORTEX, api_spoolss_AddPortEx},
+       {"SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION", NDR_SPOOLSS_ROUTERFINDFIRSTPRINTERCHANGENOTIFICATION, api_spoolss_RouterFindFirstPrinterChangeNotification},
+       {"SPOOLSS_SPOOLERINIT", NDR_SPOOLSS_SPOOLERINIT, api_spoolss_SpoolerInit},
+       {"SPOOLSS_RESETPRINTEREX", NDR_SPOOLSS_RESETPRINTEREX, api_spoolss_ResetPrinterEx},
+       {"SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX", NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX, api_spoolss_RemoteFindFirstPrinterChangeNotifyEx},
+       {"SPOOLSS_ROUTERREPLYPRINTEREX", NDR_SPOOLSS_ROUTERREPLYPRINTEREX, api_spoolss_RouterReplyPrinterEx},
+       {"SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY", NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY, api_spoolss_RouterRefreshPrinterChangeNotify},
+       {"SPOOLSS_44", NDR_SPOOLSS_44, api_spoolss_44},
+       {"SPOOLSS_OPENPRINTEREX", NDR_SPOOLSS_OPENPRINTEREX, api_spoolss_OpenPrinterEx},
+       {"SPOOLSS_ADDPRINTEREX", NDR_SPOOLSS_ADDPRINTEREX, api_spoolss_AddPrinterEx},
+       {"SPOOLSS_47", NDR_SPOOLSS_47, api_spoolss_47},
+       {"SPOOLSS_ENUMPRINTERDATA", NDR_SPOOLSS_ENUMPRINTERDATA, api_spoolss_EnumPrinterData},
+       {"SPOOLSS_DELETEPRINTERDATA", NDR_SPOOLSS_DELETEPRINTERDATA, api_spoolss_DeletePrinterData},
+       {"SPOOLSS_4A", NDR_SPOOLSS_4A, api_spoolss_4a},
+       {"SPOOLSS_4B", NDR_SPOOLSS_4B, api_spoolss_4b},
+       {"SPOOLSS_4C", NDR_SPOOLSS_4C, api_spoolss_4c},
+       {"SPOOLSS_SETPRINTERDATAEX", NDR_SPOOLSS_SETPRINTERDATAEX, api_spoolss_SetPrinterDataEx},
+       {"SPOOLSS_GETPRINTERDATAEX", NDR_SPOOLSS_GETPRINTERDATAEX, api_spoolss_GetPrinterDataEx},
+       {"SPOOLSS_ENUMPRINTERDATAEX", NDR_SPOOLSS_ENUMPRINTERDATAEX, api_spoolss_EnumPrinterDataEx},
+       {"SPOOLSS_ENUMPRINTERKEY", NDR_SPOOLSS_ENUMPRINTERKEY, api_spoolss_EnumPrinterKey},
+       {"SPOOLSS_DELETEPRINTERDATAEX", NDR_SPOOLSS_DELETEPRINTERDATAEX, api_spoolss_DeletePrinterDataEx},
+       {"SPOOLSS_DELETEPRINTERKEY", NDR_SPOOLSS_DELETEPRINTERKEY, api_spoolss_DeletePrinterKey},
+       {"SPOOLSS_53", NDR_SPOOLSS_53, api_spoolss_53},
+       {"SPOOLSS_DELETEPRINTERDRIVEREX", NDR_SPOOLSS_DELETEPRINTERDRIVEREX, api_spoolss_DeletePrinterDriverEx},
+       {"SPOOLSS_55", NDR_SPOOLSS_55, api_spoolss_55},
+       {"SPOOLSS_56", NDR_SPOOLSS_56, api_spoolss_56},
+       {"SPOOLSS_57", NDR_SPOOLSS_57, api_spoolss_57},
+       {"SPOOLSS_XCVDATA", NDR_SPOOLSS_XCVDATA, api_spoolss_XcvData},
+       {"SPOOLSS_ADDPRINTERDRIVEREX", NDR_SPOOLSS_ADDPRINTERDRIVEREX, api_spoolss_AddPrinterDriverEx},
+       {"SPOOLSS_5A", NDR_SPOOLSS_5A, api_spoolss_5a},
+       {"SPOOLSS_5B", NDR_SPOOLSS_5B, api_spoolss_5b},
+       {"SPOOLSS_5C", NDR_SPOOLSS_5C, api_spoolss_5c},
+       {"SPOOLSS_5D", NDR_SPOOLSS_5D, api_spoolss_5d},
+       {"SPOOLSS_5E", NDR_SPOOLSS_5E, api_spoolss_5e},
+       {"SPOOLSS_5F", NDR_SPOOLSS_5F, api_spoolss_5f},
+       {"SPOOLSS_60", NDR_SPOOLSS_60, api_spoolss_60},
+       {"SPOOLSS_61", NDR_SPOOLSS_61, api_spoolss_61},
+       {"SPOOLSS_62", NDR_SPOOLSS_62, api_spoolss_62},
+       {"SPOOLSS_63", NDR_SPOOLSS_63, api_spoolss_63},
+       {"SPOOLSS_64", NDR_SPOOLSS_64, api_spoolss_64},
+       {"SPOOLSS_65", NDR_SPOOLSS_65, api_spoolss_65},
+       {"SPOOLSS_GETCOREPRINTERDRIVERS", NDR_SPOOLSS_GETCOREPRINTERDRIVERS, api_spoolss_GetCorePrinterDrivers},
+       {"SPOOLSS_67", NDR_SPOOLSS_67, api_spoolss_67},
+       {"SPOOLSS_GETPRINTERDRIVERPACKAGEPATH", NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH, api_spoolss_GetPrinterDriverPackagePath},
+       {"SPOOLSS_69", NDR_SPOOLSS_69, api_spoolss_69},
+       {"SPOOLSS_6A", NDR_SPOOLSS_6A, api_spoolss_6a},
+       {"SPOOLSS_6B", NDR_SPOOLSS_6B, api_spoolss_6b},
+       {"SPOOLSS_6C", NDR_SPOOLSS_6C, api_spoolss_6c},
+       {"SPOOLSS_6D", NDR_SPOOLSS_6D, api_spoolss_6d},
+};
+
+void spoolss_get_pipe_fns(struct api_struct **fns, int *n_fns)
+{
+       *fns = api_spoolss_cmds;
+       *n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
+}
+
+NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, const struct ndr_interface_table *table, uint32_t opnum, void *_r)
+{
+       if (cli->pipes_struct == NULL) {
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
+       switch (opnum)
+       {
+               case NDR_SPOOLSS_ENUMPRINTERS: {
+                       struct spoolss_EnumPrinters *r = (struct spoolss_EnumPrinters *)_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_PrinterInfo *);
                        if (r->out.info == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumPrinters(cli->pipes_struct, r);
@@ -7488,7 +8681,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
                        if (r->out.handle == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_OpenPrinter(cli->pipes_struct, r);
@@ -7506,12 +8699,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo);
                        if (r->out.info == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetJob(cli->pipes_struct, r);
@@ -7521,14 +8714,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumJobs(cli->pipes_struct, r);
@@ -7537,6 +8735,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;
                }
@@ -7558,12 +8762,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo);
                        if (r->out.info == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetPrinter(cli->pipes_struct, r);
@@ -7579,14 +8783,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumPrinterDrivers(cli->pipes_struct, r);
@@ -7595,6 +8804,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;
                }
@@ -7604,12 +8824,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.info = talloc_zero(mem_ctx, union spoolss_DriverDirectoryInfo);
                        if (r->out.info == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetPrinterDriverDirectory(cli->pipes_struct, r);
@@ -7631,14 +8851,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumPrintProcessors(cli->pipes_struct, r);
@@ -7647,6 +8872,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;
                }
@@ -7656,7 +8892,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.job_id = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.job_id == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_StartDocPrinter(cli->pipes_struct, r);
@@ -7674,7 +8910,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.num_written = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.num_written == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_WritePrinter(cli->pipes_struct, r);
@@ -7698,12 +8934,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_size);
                        if (r->out.data == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out._data_size = talloc_zero(mem_ctx, uint32_t);
                        if (r->out._data_size == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_ReadPrinter(cli->pipes_struct, r);
@@ -7718,6 +8954,13 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
 
                case NDR_SPOOLSS_ADDJOB: {
                        struct spoolss_AddJob *r = (struct spoolss_AddJob *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.buffer = r->in.buffer;
+                       r->out.needed = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.needed == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+
                        r->out.result = _spoolss_AddJob(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
@@ -7731,14 +8974,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
+                       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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetPrinterData(cli->pipes_struct, r);
@@ -7782,12 +9030,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo);
                        if (r->out.info == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetForm(cli->pipes_struct, r);
@@ -7803,14 +9051,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumForms(cli->pipes_struct, r);
@@ -7820,14 +9073,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumPorts(cli->pipes_struct, r);
@@ -7837,14 +9095,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumMonitors(cli->pipes_struct, r);
@@ -7871,6 +9134,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;
                }
@@ -7883,6 +9152,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;
                }
@@ -7937,6 +9208,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;
                }
@@ -7950,24 +9237,24 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.server_major_version = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.server_major_version == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.server_minor_version = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.server_minor_version == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetPrinterDriver2(cli->pipes_struct, r);
@@ -8003,7 +9290,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
                        if (r->out.handle == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_ReplyOpenPrinter(cli->pipes_struct, r);
@@ -8054,21 +9341,27 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_OK;
                }
 
-               case NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFICATION: {
-                       struct spoolss_RouterRefreshPrinterChangeNotification *r = (struct spoolss_RouterRefreshPrinterChangeNotification *)_r;
-                       r->out.result = _spoolss_RouterRefreshPrinterChangeNotification(cli->pipes_struct, r);
+               case NDR_SPOOLSS_ROUTERREPLYPRINTEREX: {
+                       struct spoolss_RouterReplyPrinterEx *r = (struct spoolss_RouterReplyPrinterEx *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.reply_result = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.reply_result == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.result = _spoolss_RouterReplyPrinterEx(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
-               case NDR_SPOOLSS_REMOTEFINDNEXTPRINTERCHANGENOTIFYEX: {
-                       struct spoolss_RemoteFindNextPrinterChangeNotifyEx *r = (struct spoolss_RemoteFindNextPrinterChangeNotifyEx *)_r;
+               case NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY: {
+                       struct spoolss_RouterRefreshPrinterChangeNotify *r = (struct spoolss_RouterRefreshPrinterChangeNotify *)_r;
                        ZERO_STRUCT(r->out);
                        r->out.info = talloc_zero(mem_ctx, struct spoolss_NotifyInfo *);
                        if (r->out.info == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.result = _spoolss_RemoteFindNextPrinterChangeNotifyEx(cli->pipes_struct, r);
+                       r->out.result = _spoolss_RouterRefreshPrinterChangeNotify(cli->pipes_struct, r);
                        return NT_STATUS_OK;
                }
 
@@ -8083,7 +9376,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.handle = talloc_zero(mem_ctx, struct policy_handle);
                        if (r->out.handle == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_OpenPrinterEx(cli->pipes_struct, r);
@@ -8092,6 +9385,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;
                }
@@ -8107,27 +9406,27 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        ZERO_STRUCT(r->out);
                        r->out.value_name = talloc_zero_array(mem_ctx, const char, r->in.value_offered / 2);
                        if (r->out.value_name == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.value_needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.value_needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.printerdata_type = talloc_zero(mem_ctx, uint32_t);
-                       if (r->out.printerdata_type == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                       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) {
-                       return NT_STATUS_NO_MEMORY;
+                       r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_offered);
+                       if (r->out.data == NULL) {
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.data_needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.data_needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumPrinterData(cli->pipes_struct, r);
@@ -8167,19 +9466,19 @@ 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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
-                       r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
-                       if (r->out.buffer == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                       r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
+                       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;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_GetPrinterDataEx(cli->pipes_struct, r);
@@ -8189,19 +9488,19 @@ 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) {
-                       return NT_STATUS_NO_MEMORY;
+                       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) {
-                       return NT_STATUS_NO_MEMORY;
+                       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) {
-                       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_EnumPrinterDataEx(cli->pipes_struct, r);
@@ -8211,14 +9510,19 @@ 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._ndr_size = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out._ndr_size == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.key_buffer = talloc_zero(mem_ctx, union spoolss_KeyNames);
                        if (r->out.key_buffer == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_EnumPrinterKey(cli->pipes_struct, r);
@@ -8273,12 +9577,12 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        r->out.status_code = r->in.status_code;
                        r->out.out_data = talloc_zero_array(mem_ctx, uint8_t, r->in.out_data_size);
                        if (r->out.out_data == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.needed = talloc_zero(mem_ctx, uint32_t);
                        if (r->out.needed == NULL) {
-                       return NT_STATUS_NO_MEMORY;
+                               return NT_STATUS_NO_MEMORY;
                        }
 
                        r->out.result = _spoolss_XcvData(cli->pipes_struct, r);
@@ -8327,6 +9631,103 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
                        return NT_STATUS_OK;
                }
 
+               case NDR_SPOOLSS_60: {
+                       struct spoolss_60 *r = (struct spoolss_60 *)_r;
+                       r->out.result = _spoolss_60(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_61: {
+                       struct spoolss_61 *r = (struct spoolss_61 *)_r;
+                       r->out.result = _spoolss_61(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_62: {
+                       struct spoolss_62 *r = (struct spoolss_62 *)_r;
+                       r->out.result = _spoolss_62(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_63: {
+                       struct spoolss_63 *r = (struct spoolss_63 *)_r;
+                       r->out.result = _spoolss_63(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_64: {
+                       struct spoolss_64 *r = (struct spoolss_64 *)_r;
+                       r->out.result = _spoolss_64(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_65: {
+                       struct spoolss_65 *r = (struct spoolss_65 *)_r;
+                       r->out.result = _spoolss_65(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_GETCOREPRINTERDRIVERS: {
+                       struct spoolss_GetCorePrinterDrivers *r = (struct spoolss_GetCorePrinterDrivers *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.core_printer_drivers = talloc_zero_array(mem_ctx, struct spoolss_CorePrinterDriver, r->in.core_printer_driver_count);
+                       if (r->out.core_printer_drivers == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.result = _spoolss_GetCorePrinterDrivers(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_67: {
+                       struct spoolss_67 *r = (struct spoolss_67 *)_r;
+                       r->out.result = _spoolss_67(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_GETPRINTERDRIVERPACKAGEPATH: {
+                       struct spoolss_GetPrinterDriverPackagePath *r = (struct spoolss_GetPrinterDriverPackagePath *)_r;
+                       ZERO_STRUCT(r->out);
+                       r->out.driver_package_cab = r->in.driver_package_cab;
+                       r->out.required = talloc_zero(mem_ctx, uint32_t);
+                       if (r->out.required == NULL) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+
+                       r->out.result = _spoolss_GetPrinterDriverPackagePath(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_69: {
+                       struct spoolss_69 *r = (struct spoolss_69 *)_r;
+                       r->out.result = _spoolss_69(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_6A: {
+                       struct spoolss_6a *r = (struct spoolss_6a *)_r;
+                       r->out.result = _spoolss_6a(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_6B: {
+                       struct spoolss_6b *r = (struct spoolss_6b *)_r;
+                       r->out.result = _spoolss_6b(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_6C: {
+                       struct spoolss_6c *r = (struct spoolss_6c *)_r;
+                       r->out.result = _spoolss_6c(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
+               case NDR_SPOOLSS_6D: {
+                       struct spoolss_6d *r = (struct spoolss_6d *)_r;
+                       r->out.result = _spoolss_6d(cli->pipes_struct, r);
+                       return NT_STATUS_OK;
+               }
+
                default:
                        return NT_STATUS_NOT_IMPLEMENTED;
        }