mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
s3-spoolss: use pidl for _spoolss_RemoteFindFirstPrinterChangeNotifyEx.
Guenther
This commit is contained in:
@ -161,27 +161,7 @@ static bool api_spoolss_deleteprinterdriver(pipes_struct *p)
|
|||||||
|
|
||||||
static bool api_spoolss_rffpcnex(pipes_struct *p)
|
static bool api_spoolss_rffpcnex(pipes_struct *p)
|
||||||
{
|
{
|
||||||
SPOOL_Q_RFFPCNEX q_u;
|
return proxy_spoolss_call(p, NDR_SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX);
|
||||||
SPOOL_R_RFFPCNEX 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_rffpcnex("", &q_u, data, 0)) {
|
|
||||||
DEBUG(0,("spoolss_io_q_rffpcnex: unable to unmarshall SPOOL_Q_RFFPCNEX.\n"));
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
r_u.status = _spoolss_rffpcnex(p, &q_u, &r_u);
|
|
||||||
|
|
||||||
if (!spoolss_io_r_rffpcnex("", &r_u, rdata, 0)) {
|
|
||||||
DEBUG(0,("spoolss_io_r_rffpcnex: unable to marshall SPOOL_R_RFFPCNEX.\n"));
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
return True;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2893,26 +2893,22 @@ static struct spoolss_NotifyOption *dup_spoolss_NotifyOption(TALLOC_CTX *mem_ctx
|
|||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************
|
/****************************************************************
|
||||||
* _spoolss_rffpcnex
|
* _spoolss_RemoteFindFirstPrinterChangeNotifyEx
|
||||||
* ReplyFindFirstPrinterChangeNotifyEx
|
|
||||||
*
|
*
|
||||||
* before replying OK: status=0 a rpc call is made to the workstation
|
* before replying OK: status=0 a rpc call is made to the workstation
|
||||||
* asking ReplyOpenPrinter
|
* asking ReplyOpenPrinter
|
||||||
*
|
*
|
||||||
* in fact ReplyOpenPrinter is the changenotify equivalent on the spoolss pipe
|
* in fact ReplyOpenPrinter is the changenotify equivalent on the spoolss pipe
|
||||||
* called from api_spoolss_rffpcnex
|
* called from api_spoolss_rffpcnex
|
||||||
********************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNEX *r_u)
|
WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
|
||||||
|
struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
|
||||||
{
|
{
|
||||||
POLICY_HND *handle = &q_u->handle;
|
POLICY_HND *handle = r->in.handle;
|
||||||
uint32 flags = q_u->flags;
|
|
||||||
uint32 options = q_u->options;
|
|
||||||
UNISTR2 *localmachine = &q_u->localmachine;
|
|
||||||
uint32 printerlocal = q_u->printerlocal;
|
|
||||||
int snum = -1;
|
int snum = -1;
|
||||||
SPOOL_NOTIFY_OPTION *option = q_u->option;
|
struct spoolss_NotifyOption *option = r->in.notify_options;
|
||||||
struct sockaddr_storage client_ss;
|
struct sockaddr_storage client_ss;
|
||||||
|
|
||||||
/* store the notify value in the printer struct */
|
/* store the notify value in the printer struct */
|
||||||
@ -2920,19 +2916,19 @@ WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNE
|
|||||||
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
|
Printer_entry *Printer=find_printer_index_by_hnd(p, handle);
|
||||||
|
|
||||||
if (!Printer) {
|
if (!Printer) {
|
||||||
DEBUG(2,("_spoolss_rffpcnex: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
|
DEBUG(2,("_spoolss_RemoteFindFirstPrinterChangeNotifyEx: "
|
||||||
|
"Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle)));
|
||||||
return WERR_BADFID;
|
return WERR_BADFID;
|
||||||
}
|
}
|
||||||
|
|
||||||
Printer->notify.flags=flags;
|
Printer->notify.flags = r->in.flags;
|
||||||
Printer->notify.options=options;
|
Printer->notify.options = r->in.options;
|
||||||
Printer->notify.printerlocal=printerlocal;
|
Printer->notify.printerlocal = r->in.printer_local;
|
||||||
|
|
||||||
TALLOC_FREE(Printer->notify.option);
|
TALLOC_FREE(Printer->notify.option);
|
||||||
Printer->notify.option = dup_spoolss_NotifyOption(Printer, option);
|
Printer->notify.option = dup_spoolss_NotifyOption(Printer, option);
|
||||||
|
|
||||||
unistr2_to_ascii(Printer->notify.localmachine, localmachine,
|
fstrcpy(Printer->notify.localmachine, r->in.local_machine);
|
||||||
sizeof(Printer->notify.localmachine));
|
|
||||||
|
|
||||||
/* Connect to the client machine and send a ReplyOpenPrinter */
|
/* Connect to the client machine and send a ReplyOpenPrinter */
|
||||||
|
|
||||||
@ -10591,17 +10587,6 @@ WERROR _spoolss_ResetPrinterEx(pipes_struct *p,
|
|||||||
return WERR_NOT_SUPPORTED;
|
return WERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************
|
|
||||||
_spoolss_RemoteFindFirstPrinterChangeNotifyEx
|
|
||||||
****************************************************************/
|
|
||||||
|
|
||||||
WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
|
|
||||||
struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
|
|
||||||
{
|
|
||||||
p->rng_fault_state = true;
|
|
||||||
return WERR_NOT_SUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************
|
/****************************************************************
|
||||||
_spoolss_RouterReplyPrinterEx
|
_spoolss_RouterReplyPrinterEx
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
Reference in New Issue
Block a user