s3-spoolss: use pidl for _spoolss_RouterRefreshPrinterChangeNotify.
authorGünther Deschner <gd@samba.org>
Thu, 12 Feb 2009 13:18:28 +0000 (14:18 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 23 Feb 2009 15:17:35 +0000 (16:17 +0100)
Guenther

source3/rpc_server/srv_spoolss.c
source3/rpc_server/srv_spoolss_nt.c

index 7bb71ab89f00a4ce166dbedf9c724ff223f3cf96..17dbad698838f7a9ed4f63a1349927c139be4ca7 100644 (file)
@@ -198,30 +198,9 @@ static bool api_spoolss_rffpcnex(pipes_struct *p)
 
 static bool api_spoolss_rfnpcnex(pipes_struct *p)
 {
-       SPOOL_Q_RFNPCNEX q_u;
-       SPOOL_R_RFNPCNEX r_u;
-       prs_struct *data = &p->in_data.data;
-       prs_struct *rdata = &p->out_data.rdata;
-
-       ZERO_STRUCT(q_u);
-       ZERO_STRUCT(r_u);
-
-       if (!spoolss_io_q_rfnpcnex("", &q_u, data, 0)) {
-               DEBUG(0,("spoolss_io_q_rfnpcnex: unable to unmarshall SPOOL_Q_RFNPCNEX.\n"));
-               return False;
-       }
-
-       r_u.status = _spoolss_rfnpcnex(p, &q_u, &r_u);
-
-       if (!spoolss_io_r_rfnpcnex("", &r_u, rdata, 0)) {
-               SAFE_FREE(r_u.info.data);
-               DEBUG(0,("spoolss_io_r_rfnpcnex: unable to marshall SPOOL_R_RFNPCNEX.\n"));
-               return False;
-       }
-
-       SAFE_FREE(r_u.info.data);
-
-       return True;
+       return proxy_spoolss_call(p, NDR_SPOOLSS_ROUTERREFRESHPRINTERCHANGENOTIFY);
+       /* FIXME */
+//     SAFE_FREE(r_u.info.data);
 }
 
 
index eb04cadf40f8500182cb41f5bd86593e5fc6de1c..c351c2fa2b57504aa8e7abf892d3d31aa63912a4 100644 (file)
@@ -3794,24 +3794,31 @@ static WERROR printer_notify_info(pipes_struct *p, POLICY_HND *hnd, struct spool
        return WERR_OK;
 }
 
-/********************************************************************
- * spoolss_rfnpcnex
- ********************************************************************/
+/****************************************************************
+ _spoolss_RouterRefreshPrinterChangeNotify
+****************************************************************/
 
-WERROR _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCNEX *r_u)
+WERROR _spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p,
+                                                struct spoolss_RouterRefreshPrinterChangeNotify *r)
 {
-       POLICY_HND *handle = &q_u->handle;
-       SPOOL_NOTIFY_INFO *info = &r_u->info;
+       POLICY_HND *handle = r->in.handle;
+       struct spoolss_NotifyInfo *info;
 
        Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
        WERROR result = WERR_BADFID;
 
-       /* we always have a NOTIFY_INFO struct */
-       r_u->info_ptr=0x1;
+       /* we always have a spoolss_NotifyInfo struct */
+       info = talloc_zero(p->mem_ctx, struct spoolss_NotifyInfo);
+       if (!info) {
+               result = WERR_NOMEM;
+               goto done;
+       }
+
+       *r->out.info = info;
 
        if (!Printer) {
-               DEBUG(2,("_spoolss_rfnpcnex: Invalid handle (%s:%u:%u).\n",
-                        OUR_HANDLE(handle)));
+               DEBUG(2,("_spoolss_RouterRefreshPrinterChangeNotify: "
+                       "Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
                goto done;
        }
 
@@ -3830,8 +3837,10 @@ WERROR _spoolss_rfnpcnex( pipes_struct *p, SPOOL_Q_RFNPCNEX *q_u, SPOOL_R_RFNPCN
        Printer->notify.fnpcn = True;
 
        if (Printer->notify.client_connected) {
-               DEBUG(10,("_spoolss_rfnpcnex: Saving change value in request [%x]\n", q_u->change));
-               Printer->notify.change = q_u->change;
+               DEBUG(10,("_spoolss_RouterRefreshPrinterChangeNotify: "
+                       "Saving change value in request [%x]\n",
+                       r->in.change_low));
+               Printer->notify.change = r->in.change_low;
        }
 
        /* just ignore the SPOOL_NOTIFY_OPTION */
@@ -10552,17 +10561,6 @@ WERROR _spoolss_RouterReplyPrinterEx(pipes_struct *p,
        return WERR_NOT_SUPPORTED;
 }
 
-/****************************************************************
- _dcesrv_spoolss_RouterRefreshPrinterChangeNotify
-****************************************************************/
-
-WERROR _spoolss_RouterRefreshPrinterChangeNotify(pipes_struct *p,
-                                                struct spoolss_RouterRefreshPrinterChangeNotify *r)
-{
-       p->rng_fault_state = true;
-       return WERR_NOT_SUPPORTED;
-}
-
 /****************************************************************
  _spoolss_44
 ****************************************************************/