summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lsarpcd/srv_lsa.c16
-rw-r--r--source3/printing/nt_printing.c4
-rw-r--r--source3/rpc_parse/parse_rpc.c11
-rw-r--r--source3/rpc_server/srv_lsa.c16
-rw-r--r--source3/rpc_server/srv_netlog.c42
-rw-r--r--source3/rpc_server/srv_pipe.c2
-rw-r--r--source3/rpc_server/srv_reg.c8
-rw-r--r--source3/rpc_server/srv_samr.c74
-rwxr-xr-xsource3/rpc_server/srv_spoolss.c253
-rw-r--r--source3/rpc_server/srv_srvsvc.c12
-rw-r--r--source3/rpc_server/srv_svcctl.c12
-rw-r--r--source3/rpc_server/srv_wkssvc.c2
-rw-r--r--source3/rpcclient/display.c76
-rw-r--r--source3/rpcclient/rpcclient.c1
14 files changed, 314 insertions, 215 deletions
diff --git a/source3/lsarpcd/srv_lsa.c b/source3/lsarpcd/srv_lsa.c
index 61aac58e62..d8a74d627b 100644
--- a/source3/lsarpcd/srv_lsa.c
+++ b/source3/lsarpcd/srv_lsa.c
@@ -435,7 +435,7 @@ static void lsa_reply_lookup_names(prs_struct *rdata,
/***************************************************************************
api_lsa_open_policy
***************************************************************************/
-static void api_lsa_open_policy2( uint16 vuid, prs_struct *data,
+static void api_lsa_open_policy2( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_OPEN_POL2 q_o;
@@ -454,7 +454,7 @@ static void api_lsa_open_policy2( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_open_policy
***************************************************************************/
-static void api_lsa_open_policy( uint16 vuid, prs_struct *data,
+static void api_lsa_open_policy( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_OPEN_POL q_o;
@@ -473,7 +473,7 @@ static void api_lsa_open_policy( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_enum_trust_dom
***************************************************************************/
-static void api_lsa_enum_trust_dom( uint16 vuid, prs_struct *data,
+static void api_lsa_enum_trust_dom( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_ENUM_TRUST_DOM q_e;
@@ -490,7 +490,7 @@ static void api_lsa_enum_trust_dom( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_query_info
***************************************************************************/
-static void api_lsa_query_info( uint16 vuid, prs_struct *data,
+static void api_lsa_query_info( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_QUERY_INFO q_i;
@@ -532,7 +532,7 @@ static void api_lsa_query_info( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_lookup_sids
***************************************************************************/
-static void api_lsa_lookup_sids( uint16 vuid, prs_struct *data,
+static void api_lsa_lookup_sids( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_LOOKUP_SIDS q_l;
@@ -548,7 +548,7 @@ static void api_lsa_lookup_sids( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_lookup_names
***************************************************************************/
-static void api_lsa_lookup_names( uint16 vuid, prs_struct *data,
+static void api_lsa_lookup_names( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_LOOKUP_NAMES q_l;
@@ -565,7 +565,7 @@ static void api_lsa_lookup_names( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_close
***************************************************************************/
-static void api_lsa_close( uint16 vuid, prs_struct *data,
+static void api_lsa_close( pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
/* XXXX this is NOT good */
@@ -590,7 +590,7 @@ static void api_lsa_close( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_open_secret
***************************************************************************/
-static void api_lsa_open_secret( uint16 vuid, prs_struct *data,
+static void api_lsa_open_secret( pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
/* XXXX this is NOT good */
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 75dd2d2551..76b9ee909d 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -93,7 +93,7 @@ get the nt drivers list
open the rectory and look-up the matching names
****************************************************************************/
-int get_ntdrivers(fstring **list, char *architecture)
+int get_ntdrivers(connection_struct *conn, fstring **list, char *architecture)
{
void *dirp;
char *dpname;
@@ -106,7 +106,7 @@ int get_ntdrivers(fstring **list, char *architecture)
DEBUG(5,("Getting the driver list from directory: [%s]\n", lp_nt_drivers_file()));
*list=NULL;
- dirp = OpenDir(NULL, lp_nt_drivers_file(), False);
+ dirp = OpenDir(conn, lp_nt_drivers_file(), False);
if (!dirp)
{
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c
index 2f47f06e36..524c4201ad 100644
--- a/source3/rpc_parse/parse_rpc.c
+++ b/source3/rpc_parse/parse_rpc.c
@@ -152,6 +152,16 @@ interface/version dce/rpc pipe identification
}, 0x00 \
} \
+#define SYNT_EVENTLOG_V0 \
+{ \
+ { \
+ 0xdc, 0x3f, 0x27, 0x82, \
+ 0x2a, 0xe3, 0xc3, 0x18, \
+ 0x3f, 0x78, 0x82, 0x79, \
+ 0x29, 0xdc, 0x23, 0xea \
+ }, 0x00 \
+}
+ \
struct pipe_id_info pipe_names [] =
{
/* client pipe , abstract syntax , server pipe , transfer syntax */
@@ -164,6 +174,7 @@ struct pipe_id_info pipe_names [] =
{ PIPE_WINREG , SYNT_WINREG_V1 , PIPE_WINREG , TRANS_SYNT_V2 },
{ PIPE_ATSVC , SYNT_ATSVC_V1 , PIPE_ATSVC , TRANS_SYNT_V2 },
{ PIPE_SPOOLSS , SYNT_SPOOLSS_V1 , PIPE_SPOOLSS , TRANS_SYNT_V2 },
+ { PIPE_EVENTLOG, SYNT_EVENTLOG_V0, PIPE_EVENTLOG , TRANS_SYNT_V2 },
{ NULL , SYNT_NONE_V0 , NULL , SYNT_NONE_V0 }
};
diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c
index 61aac58e62..d8a74d627b 100644
--- a/source3/rpc_server/srv_lsa.c
+++ b/source3/rpc_server/srv_lsa.c
@@ -435,7 +435,7 @@ static void lsa_reply_lookup_names(prs_struct *rdata,
/***************************************************************************
api_lsa_open_policy
***************************************************************************/
-static void api_lsa_open_policy2( uint16 vuid, prs_struct *data,
+static void api_lsa_open_policy2( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_OPEN_POL2 q_o;
@@ -454,7 +454,7 @@ static void api_lsa_open_policy2( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_open_policy
***************************************************************************/
-static void api_lsa_open_policy( uint16 vuid, prs_struct *data,
+static void api_lsa_open_policy( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_OPEN_POL q_o;
@@ -473,7 +473,7 @@ static void api_lsa_open_policy( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_enum_trust_dom
***************************************************************************/
-static void api_lsa_enum_trust_dom( uint16 vuid, prs_struct *data,
+static void api_lsa_enum_trust_dom( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_ENUM_TRUST_DOM q_e;
@@ -490,7 +490,7 @@ static void api_lsa_enum_trust_dom( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_query_info
***************************************************************************/
-static void api_lsa_query_info( uint16 vuid, prs_struct *data,
+static void api_lsa_query_info( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_QUERY_INFO q_i;
@@ -532,7 +532,7 @@ static void api_lsa_query_info( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_lookup_sids
***************************************************************************/
-static void api_lsa_lookup_sids( uint16 vuid, prs_struct *data,
+static void api_lsa_lookup_sids( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_LOOKUP_SIDS q_l;
@@ -548,7 +548,7 @@ static void api_lsa_lookup_sids( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_lookup_names
***************************************************************************/
-static void api_lsa_lookup_names( uint16 vuid, prs_struct *data,
+static void api_lsa_lookup_names( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
LSA_Q_LOOKUP_NAMES q_l;
@@ -565,7 +565,7 @@ static void api_lsa_lookup_names( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_close
***************************************************************************/
-static void api_lsa_close( uint16 vuid, prs_struct *data,
+static void api_lsa_close( pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
/* XXXX this is NOT good */
@@ -590,7 +590,7 @@ static void api_lsa_close( uint16 vuid, prs_struct *data,
/***************************************************************************
api_lsa_open_secret
***************************************************************************/
-static void api_lsa_open_secret( uint16 vuid, prs_struct *data,
+static void api_lsa_open_secret( pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
/* XXXX this is NOT good */
diff --git a/source3/rpc_server/srv_netlog.c b/source3/rpc_server/srv_netlog.c
index c84e91f643..44ad4fd064 100644
--- a/source3/rpc_server/srv_netlog.c
+++ b/source3/rpc_server/srv_netlog.c
@@ -310,7 +310,7 @@ static BOOL get_md4pw(char *md4pw, char *mach_name, char *mach_acct)
/*************************************************************************
api_net_req_chal:
*************************************************************************/
-static void api_net_req_chal( uint16 vuid,
+static void api_net_req_chal( pipes_struct *p,
prs_struct *data,
prs_struct *rdata)
{
@@ -322,9 +322,9 @@ static void api_net_req_chal( uint16 vuid,
user_struct *vuser;
- DEBUG(5,("api_net_req_chal(%d): vuid %d\n", __LINE__, (int)vuid));
+ DEBUG(5,("api_net_req_chal(%d): vuid %d\n", __LINE__, (int)p->vuid));
- if ((vuser = get_valid_user_struct(vuid)) == NULL)
+ if ((vuser = get_valid_user_struct(p->vuid)) == NULL)
return;
/* grab the challenge... */
@@ -370,7 +370,7 @@ static void api_net_req_chal( uint16 vuid,
/*************************************************************************
api_net_auth_2:
*************************************************************************/
-static void api_net_auth_2( uint16 vuid,
+static void api_net_auth_2( pipes_struct *p,
prs_struct *data,
prs_struct *rdata)
{
@@ -382,7 +382,7 @@ static void api_net_auth_2( uint16 vuid,
user_struct *vuser;
- if ((vuser = get_valid_user_struct(vuid)) == NULL)
+ if ((vuser = get_valid_user_struct(p->vuid)) == NULL)
return;
srv_time.time = 0;
@@ -415,7 +415,7 @@ static void api_net_auth_2( uint16 vuid,
/*************************************************************************
api_net_srv_pwset:
*************************************************************************/
-static void api_net_srv_pwset( uint16 vuid,
+static void api_net_srv_pwset( pipes_struct *p,
prs_struct *data,
prs_struct *rdata)
{
@@ -427,7 +427,7 @@ static void api_net_srv_pwset( uint16 vuid,
BOOL ret;
user_struct *vuser;
- if ((vuser = get_valid_user_struct(vuid)) == NULL)
+ if ((vuser = get_valid_user_struct(p->vuid)) == NULL)
return;
/* grab the challenge and encrypted password ... */
@@ -497,9 +497,9 @@ static void api_net_srv_pwset( uint16 vuid,
/*************************************************************************
api_net_sam_logoff:
*************************************************************************/
-static void api_net_sam_logoff( uint16 vuid,
- prs_struct *data,
- prs_struct *rdata)
+static void api_net_sam_logoff( pipes_struct *p,
+ prs_struct *data,
+ prs_struct *rdata)
{
NET_Q_SAM_LOGOFF q_l;
NET_ID_INFO_CTR ctr;
@@ -508,7 +508,7 @@ static void api_net_sam_logoff( uint16 vuid,
user_struct *vuser;
- if ((vuser = get_valid_user_struct(vuid)) == NULL)
+ if ((vuser = get_valid_user_struct(p->vuid)) == NULL)
return;
/* the DOM_ID_INFO_1 structure is a bit big. plus we might want to
@@ -532,16 +532,16 @@ static void api_net_sam_logoff( uint16 vuid,
/*************************************************************************
api_net_sam_sync:
*************************************************************************/
-static void api_net_sam_sync( uint16 vuid,
- prs_struct *data,
- prs_struct *rdata)
+static void api_net_sam_sync( pipes_struct *p,
+ prs_struct *data,
+ prs_struct *rdata)
{
NET_Q_SAM_SYNC q_s;
DOM_CRED srv_creds;
user_struct *vuser;
uint32 status = 0x0;
- if ((vuser = get_valid_user_struct(vuid)) == NULL)
+ if ((vuser = get_valid_user_struct(p->vuid)) == NULL)
return;
/* grab the challenge... */
@@ -671,7 +671,7 @@ static uint32 net_login_network(NET_ID_INFO_2 *id2,
/*************************************************************************
api_net_sam_logon:
*************************************************************************/
-static void api_net_sam_logon( uint16 vuid,
+static void api_net_sam_logon( pipes_struct *p,
prs_struct *data,
prs_struct *rdata)
{
@@ -704,7 +704,7 @@ static void api_net_sam_logon( uint16 vuid,
user_struct *vuser = NULL;
- if ((vuser = get_valid_user_struct(vuid)) == NULL)
+ if ((vuser = get_valid_user_struct(p->vuid)) == NULL)
return;
q_l.sam_id.ctr = &ctr;
@@ -890,9 +890,9 @@ static void api_net_sam_logon( uint16 vuid,
/*************************************************************************
api_net_trust_dom_list:
*************************************************************************/
-static void api_net_trust_dom_list( uint16 vuid,
- prs_struct *data,
- prs_struct *rdata)
+static void api_net_trust_dom_list( pipes_struct *p,
+ prs_struct *data,
+ prs_struct *rdata)
{
NET_Q_TRUST_DOM_LIST q_t;
@@ -920,7 +920,7 @@ static void api_net_trust_dom_list( uint16 vuid,
/*************************************************************************
api_net_logon_ctrl2:
*************************************************************************/
-static void api_net_logon_ctrl2( uint16 vuid,
+static void api_net_logon_ctrl2( pipes_struct *p,
prs_struct *data,
prs_struct *rdata)
{
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 466d56b67a..d98fecbc1f 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -739,7 +739,7 @@ static BOOL api_rpc_command(pipes_struct *p,
prs_init(&p->rdata, 1024, 4, SAFETY_MARGIN, False);
/* do the actual command */
- api_rpc_cmds[fn_num].fn(p->vuid, data, &(p->rdata));
+ api_rpc_cmds[fn_num].fn(p, data, &(p->rdata));
if (p->rdata.data == NULL || p->rdata.offset == 0)
{
diff --git a/source3/rpc_server/srv_reg.c b/source3/rpc_server/srv_reg.c
index d9aedc86bd..ea53f2ee2b 100644
--- a/source3/rpc_server/srv_reg.c
+++ b/source3/rpc_server/srv_reg.c
@@ -61,7 +61,7 @@ static void reg_reply_close(REG_Q_CLOSE *q_r,
/*******************************************************************
api_reg_close
********************************************************************/
-static void api_reg_close( uint16 vuid, prs_struct *data,
+static void api_reg_close( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
REG_Q_CLOSE q_r;
@@ -100,7 +100,7 @@ static void reg_reply_open(REG_Q_OPEN_HKLM *q_r,
/*******************************************************************
api_reg_open
********************************************************************/
-static void api_reg_open( uint16 vuid, prs_struct *data,
+static void api_reg_open( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
REG_Q_OPEN_HKLM q_u;
@@ -164,7 +164,7 @@ static void reg_reply_open_entry(REG_Q_OPEN_ENTRY *q_u,
/*******************************************************************
api_reg_open_entry
********************************************************************/
-static void api_reg_open_entry( uint16 vuid, prs_struct *data,
+static void api_reg_open_entry( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
REG_Q_OPEN_ENTRY q_u;
@@ -209,7 +209,7 @@ static void reg_reply_info(REG_Q_INFO *q_u,
/*******************************************************************
api_reg_info
********************************************************************/
-static void api_reg_info( uint16 vuid, prs_struct *data,
+static void api_reg_info( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
REG_Q_INFO q_u;
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index 008ad57c4d..257f8869f7 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -145,7 +145,7 @@ static void samr_reply_close_hnd(SAMR_Q_CLOSE_HND *q_u,
/*******************************************************************
api_samr_close_hnd
********************************************************************/
-static void api_samr_close_hnd( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_close_hnd( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CLOSE_HND q_u;
samr_io_q_close_hnd("", &q_u, data, 0);
@@ -200,7 +200,7 @@ static void samr_reply_open_domain(SAMR_Q_OPEN_DOMAIN *q_u,
/*******************************************************************
api_samr_open_domain
********************************************************************/
-static void api_samr_open_domain( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_open_domain( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_OPEN_DOMAIN q_u;
samr_io_q_open_domain("", &q_u, data, 0);
@@ -243,7 +243,7 @@ static void samr_reply_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u,
/*******************************************************************
api_samr_unknown_2c
********************************************************************/
-static void api_samr_unknown_2c( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_unknown_2c( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_UNKNOWN_2C q_u;
samr_io_q_unknown_2c("", &q_u, data, 0);
@@ -312,7 +312,7 @@ static void samr_reply_unknown_3(SAMR_Q_UNKNOWN_3 *q_u,
/*******************************************************************
api_samr_unknown_3
********************************************************************/
-static void api_samr_unknown_3( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_unknown_3( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_UNKNOWN_3 q_u;
samr_io_q_unknown_3("", &q_u, data, 0);
@@ -370,7 +370,7 @@ static void samr_reply_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_u,
/*******************************************************************
api_samr_enum_dom_users
********************************************************************/
-static void api_samr_enum_dom_users( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_enum_dom_users( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_ENUM_DOM_USERS q_e;
samr_io_q_enum_dom_users("", &q_e, data, 0);
@@ -429,7 +429,7 @@ static void samr_reply_add_groupmem(SAMR_Q_ADD_GROUPMEM *q_u,
/*******************************************************************
api_samr_add_groupmem
********************************************************************/
-static void api_samr_add_groupmem( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_add_groupmem( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_ADD_GROUPMEM q_e;
samr_io_q_add_groupmem("", &q_e, data, 0);
@@ -487,7 +487,7 @@ static void samr_reply_del_groupmem(SAMR_Q_DEL_GROUPMEM *q_u,
/*******************************************************************
api_samr_del_groupmem
********************************************************************/
-static void api_samr_del_groupmem( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_del_groupmem( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_DEL_GROUPMEM q_e;
samr_io_q_del_groupmem("", &q_e, data, 0);
@@ -553,7 +553,7 @@ static void samr_reply_add_aliasmem(SAMR_Q_ADD_ALIASMEM *q_u,
/*******************************************************************
api_samr_add_aliasmem
********************************************************************/
-static void api_samr_add_aliasmem( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_add_aliasmem( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_ADD_ALIASMEM q_e;
samr_io_q_add_aliasmem("", &q_e, data, 0);
@@ -619,7 +619,7 @@ static void samr_reply_del_aliasmem(SAMR_Q_DEL_ALIASMEM *q_u,
/*******************************************************************
api_samr_del_aliasmem
********************************************************************/
-static void api_samr_del_aliasmem( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_del_aliasmem( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_DEL_ALIASMEM q_e;
samr_io_q_del_aliasmem("", &q_e, data, 0);
@@ -683,7 +683,7 @@ static void samr_reply_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_u,
/*******************************************************************
api_samr_enum_dom_aliases
********************************************************************/
-static void api_samr_enum_dom_groups( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_enum_dom_groups( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_ENUM_DOM_GROUPS q_e;
@@ -768,7 +768,7 @@ static void samr_reply_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_u,
/*******************************************************************
api_samr_enum_dom_aliases
********************************************************************/
-static void api_samr_enum_dom_aliases( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_enum_dom_aliases( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_ENUM_DOM_ALIASES q_e;
@@ -940,7 +940,7 @@ static void samr_reply_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_u,
/*******************************************************************
api_samr_query_dispinfo
********************************************************************/
-static void api_samr_query_dispinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_dispinfo( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_DISPINFO q_e;
@@ -1002,7 +1002,7 @@ static void samr_reply_delete_dom_group(SAMR_Q_DELETE_DOM_GROUP *q_u,
/*******************************************************************
api_samr_delete_dom_group
********************************************************************/
-static void api_samr_delete_dom_group( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_delete_dom_group( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_DELETE_DOM_GROUP q_u;
samr_io_q_delete_dom_group("", &q_u, data, 0);
@@ -1097,7 +1097,7 @@ static void samr_reply_query_groupmem(SAMR_Q_QUERY_GROUPMEM *q_u,
/*******************************************************************
api_samr_query_groupmem
********************************************************************/
-static void api_samr_query_groupmem( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_groupmem( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_GROUPMEM q_u;
samr_io_q_query_groupmem("", &q_u, data, 0);
@@ -1157,7 +1157,7 @@ static void samr_reply_query_groupinfo(SAMR_Q_QUERY_GROUPINFO *q_u,
/*******************************************************************
api_samr_query_groupinfo
********************************************************************/
-static void api_samr_query_groupinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_groupinfo( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_GROUPINFO q_e;
samr_io_q_query_groupinfo("", &q_e, data, 0);
@@ -1211,7 +1211,7 @@ static void samr_reply_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_u,
/*******************************************************************
api_samr_query_aliasinfo
********************************************************************/
-static void api_samr_query_aliasinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_aliasinfo( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_ALIASINFO q_e;
samr_io_q_query_aliasinfo("", &q_e, data, 0);
@@ -1332,7 +1332,7 @@ static void samr_reply_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u,
/*******************************************************************
api_samr_query_useraliases
********************************************************************/
-static void api_samr_query_useraliases( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_useraliases( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_USERALIASES q_u;
samr_io_q_query_useraliases("", &q_u, data, 0);
@@ -1393,7 +1393,7 @@ static void samr_reply_delete_dom_alias(SAMR_Q_DELETE_DOM_ALIAS *q_u,
/*******************************************************************
api_samr_delete_dom_alias
********************************************************************/
-static void api_samr_delete_dom_alias( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_delete_dom_alias( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_DELETE_DOM_ALIAS q_u;
samr_io_q_delete_dom_alias("", &q_u, data, 0);
@@ -1488,7 +1488,7 @@ static void samr_reply_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_u,
/*******************************************************************
api_samr_query_aliasmem
********************************************************************/
-static void api_samr_query_aliasmem( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_aliasmem( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_ALIASMEM q_u;
samr_io_q_query_aliasmem("", &q_u, data, 0);
@@ -1560,7 +1560,7 @@ static void samr_reply_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u,
/*******************************************************************
api_samr_lookup_names
********************************************************************/
-static void api_samr_lookup_names( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_lookup_names( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_LOOKUP_NAMES q_u;
samr_io_q_lookup_names("", &q_u, data, 0);
@@ -1601,7 +1601,7 @@ static void samr_reply_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u,
/*******************************************************************
api_samr_chgpasswd_user
********************************************************************/
-static void api_samr_chgpasswd_user( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_chgpasswd_user( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CHGPASSWD_USER q_u;
samr_io_q_chgpasswd_user("", &q_u, data, 0);
@@ -1630,7 +1630,7 @@ static void samr_reply_unknown_38(SAMR_Q_UNKNOWN_38 *q_u,
/*******************************************************************
api_samr_unknown_38
********************************************************************/
-static void api_samr_unknown_38( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_unknown_38( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_UNKNOWN_38 q_u;
samr_io_q_unknown_38("", &q_u, data, 0);
@@ -1695,7 +1695,7 @@ static void samr_reply_lookup_rids(SAMR_Q_LOOKUP_RIDS *q_u,
/*******************************************************************
api_samr_lookup_rids
********************************************************************/
-static void api_samr_lookup_rids( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_lookup_rids( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_LOOKUP_RIDS q_u;
samr_io_q_lookup_rids("", &q_u, data, 0);
@@ -1765,7 +1765,7 @@ static void samr_reply_open_user(SAMR_Q_OPEN_USER *q_u,
/*******************************************************************
api_samr_open_user
********************************************************************/
-static void api_samr_open_user( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_open_user( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_OPEN_USER q_u;
samr_io_q_open_user("", &q_u, data, 0);
@@ -2019,7 +2019,7 @@ static BOOL set_user_info_23(SAM_USER_INFO_23 *id23, uint32 rid)
/*******************************************************************
api_samr_query_userinfo
********************************************************************/
-static void api_samr_query_userinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_userinfo( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_USERINFO q_u;
samr_io_q_query_userinfo("", &q_u, data, 0);
@@ -2096,9 +2096,9 @@ static void samr_reply_set_userinfo(SAMR_Q_SET_USERINFO *q_u,
/*******************************************************************
api_samr_set_userinfo
********************************************************************/
-static void api_samr_set_userinfo( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_set_userinfo( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
- user_struct *vuser = get_valid_user_struct(vuid);
+ user_struct *vuser = get_valid_user_struct(p->vuid);
SAMR_Q_SET_USERINFO q_u;
ZERO_STRUCT(q_u);
@@ -2191,7 +2191,7 @@ static void samr_reply_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u,
/*******************************************************************
api_samr_query_usergroups
********************************************************************/
-static void api_samr_query_usergroups( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_usergroups( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_USERGROUPS q_u;
samr_io_q_query_usergroups("", &q_u, data, 0);
@@ -2302,7 +2302,7 @@ static void samr_reply_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS *q_u,
/*******************************************************************
api_samr_create_dom_alias
********************************************************************/
-static void api_samr_create_dom_alias( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_create_dom_alias( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CREATE_DOM_ALIAS q_u;
samr_io_q_create_dom_alias("", &q_u, data, 0);
@@ -2414,7 +2414,7 @@ static void samr_reply_create_dom_group(SAMR_Q_CREATE_DOM_GROUP *q_u,
/*******************************************************************
api_samr_create_dom_group
********************************************************************/
-static void api_samr_create_dom_group( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_create_dom_group( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CREATE_DOM_GROUP q_u;
samr_io_q_create_dom_group("", &q_u, data, 0);
@@ -2506,7 +2506,7 @@ static void samr_reply_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u,
/*******************************************************************
api_samr_query_dom_info
********************************************************************/
-static void api_samr_query_dom_info( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_query_dom_info( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_QUERY_DOMAIN_INFO q_e;
samr_io_q_query_dom_info("", &q_e, data, 0);
@@ -2612,7 +2612,7 @@ static void samr_reply_create_user(SAMR_Q_CREATE_USER *q_u,
/*******************************************************************
api_samr_create_user
********************************************************************/
-static void api_samr_create_user( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_create_user( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CREATE_USER q_u;
@@ -2666,7 +2666,7 @@ static void samr_reply_connect_anon(SAMR_Q_CONNECT_ANON *q_u,
/*******************************************************************
api_samr_connect_anon
********************************************************************/
-static void api_samr_connect_anon( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_connect_anon( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CONNECT_ANON q_u;
samr_io_q_connect_anon("", &q_u, data, 0);
@@ -2715,7 +2715,7 @@ static void samr_reply_connect(SAMR_Q_CONNECT *q_u,
/*******************************************************************
api_samr_connect
********************************************************************/
-static void api_samr_connect( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_connect( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_CONNECT q_u;
samr_io_q_connect("", &q_u, data, 0);
@@ -2781,7 +2781,7 @@ static void samr_reply_open_alias(SAMR_Q_OPEN_ALIAS *q_u,
/*******************************************************************
api_samr_open_alias
********************************************************************/
-static void api_samr_open_alias( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_open_alias( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_OPEN_ALIAS q_u;
@@ -2828,7 +2828,7 @@ static void samr_reply_open_group(SAMR_Q_OPEN_GROUP *q_u,
/*******************************************************************
api_samr_open_group
********************************************************************/
-static void api_samr_open_group( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_open_group( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_OPEN_GROUP q_u;
@@ -2887,7 +2887,7 @@ static void samr_reply_lookup_domain(SAMR_Q_LOOKUP_DOMAIN *q_u,
/*******************************************************************
api_samr_lookup_domain
********************************************************************/
-static void api_samr_lookup_domain( uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_samr_lookup_domain( pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SAMR_Q_LOOKUP_DOMAIN q_u;
samr_io_q_lookup_domain("", &q_u, data, 0);
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index 52b60c5017..5b3ea4502a 100755
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -4,7 +4,7 @@
* RPC Pipe client / server routines
* Copyright (C) Andrew Tridgell 1992-1998,
* Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
- * Copyright (C) Jean François Micouleau 1998.
+ * Copyright (C) Jean François Micouleau 1998-1999.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -269,6 +269,7 @@ static BOOL set_printer_hnd_printername(PRINTER_HND *hnd, char *printername)
{
DEBUGADD(4,("Printer found: %s[%x]\n",lp_servicename(snum),snum));
strncpy(Printer[pnum].dev.printername, lp_servicename(snum), strlen(lp_servicename(snum)));
+ free_a_printer(printer, 2);
return True;
break;
}
@@ -413,7 +414,7 @@ static void spoolss_reply_open_printer(SPOOL_Q_OPEN_PRINTER *q_u, prs_struct *rd
*
* called from the spoolss dispatcher
********************************************************************/
-static void api_spoolss_open_printer(uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_spoolss_open_printer(pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SPOOL_Q_OPEN_PRINTER q_u;
@@ -516,7 +517,7 @@ static BOOL getprinterdata_printer(PRINTER_HND *handle, fstring value, uint32 si
NT_PRINTER_INFO_LEVEL printer;
int pnum=0;
int snum=0;
- uint8 *idata;
+ uint8 *idata=NULL;
uint32 len;
DEBUG(5,("getprinterdata_printer\n"));
@@ -538,6 +539,7 @@ static BOOL getprinterdata_printer(PRINTER_HND *handle, fstring value, uint32 si
bzero(*data, sizeof(uint8)*size);
memcpy(*data, idata, len>size?size:len);
*needed = len;
+ if (idata) free(idata);
break;
/*case 4:
*numeric_data=atoi(idata);
@@ -545,7 +547,7 @@ static BOOL getprinterdata_printer(PRINTER_HND *handle, fstring value, uint32 si
}
return (True);
}
-
+ free_a_printer(printer, 2);
}
return (False);
@@ -581,6 +583,10 @@ static void spoolss_reply_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u, prs_struct
{
r_u.size = q_u->size;
r_u.status = 0x0;
+ r_u.type = 0x4;
+ r_u.needed = 0x0;
+ r_u.data = NULL;
+ r_u.numeric_data=0x0;
unistr2_to_ascii(value, &(q_u->valuename), sizeof(value)-1);
@@ -609,6 +615,7 @@ static void spoolss_reply_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u, prs_struct
}
spoolss_io_r_getprinterdata("", &r_u, rdata, 0);
+ if (r_u.data) free(r_u.data);
}
}
@@ -617,7 +624,7 @@ static void spoolss_reply_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u, prs_struct
*
* called from the spoolss dispatcher
********************************************************************/
-static void api_spoolss_getprinterdata(uint16 vuid, prs_struct *data,
+static void api_spoolss_getprinterdata(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_GETPRINTERDATA q_u;
@@ -661,7 +668,7 @@ static void spoolss_reply_closeprinter(SPOOL_Q_CLOSEPRINTER *q_u, prs_struct *rd
*
* called from the spoolss dispatcher
********************************************************************/
-static void api_spoolss_closeprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_closeprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_CLOSEPRINTER q_u;
@@ -696,7 +703,7 @@ static void spoolss_reply_rffpcnex(SPOOL_Q_RFFPCNEX *q_u, prs_struct *rdata)
*
* in fact ReplyOpenPrinter is the changenotify equivalent on the spoolss pipe
********************************************************************/
-static void api_spoolss_rffpcnex(uint16 vuid, prs_struct *data,
+static void api_spoolss_rffpcnex(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_RFFPCNEX q_u;
@@ -732,7 +739,7 @@ static void api_spoolss_rffpcnex(uint16 vuid, prs_struct *data,
/*******************************************************************
* fill a notify_info_data with the servername
********************************************************************/
-static void spoolss_notify_server_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_server_name(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
pstring temp_name;
@@ -746,7 +753,7 @@ static void spoolss_notify_server_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, p
* fill a notify_info_data with the servicename
* jfmxxxx: it's incorrect should be long_printername
********************************************************************/
-static void spoolss_notify_printer_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_printer_name(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
/*
data->notify_data.data.length=strlen(lp_servicename(snum));
@@ -761,7 +768,7 @@ static void spoolss_notify_printer_name(int snum, SPOOL_NOTIFY_INFO_DATA *data,
/*******************************************************************
* fill a notify_info_data with the servicename
********************************************************************/
-static void spoolss_notify_share_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_share_name(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(lp_servicename(snum));
ascii_to_unistr(data->notify_data.data.string,
@@ -772,7 +779,7 @@ static void spoolss_notify_share_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, pr
/*******************************************************************
* fill a notify_info_data with the port name
********************************************************************/
-static void spoolss_notify_port_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_port_name(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
/* even if it's strange, that's consistant in all the code */
@@ -787,7 +794,7 @@ static void spoolss_notify_port_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, pri
* jfmxxxx: it's incorrect, should be lp_printerdrivername()
* but it doesn't exist, have to see what to do
********************************************************************/
-static void spoolss_notify_driver_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_driver_name(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(printer->info_2->drivername);
ascii_to_unistr(data->notify_data.data.string,
@@ -798,7 +805,7 @@ static void spoolss_notify_driver_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, p
/*******************************************************************
* fill a notify_info_data with the comment
********************************************************************/
-static void spoolss_notify_comment(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_comment(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(lp_comment(snum));
ascii_to_unistr(data->notify_data.data.string,
@@ -811,7 +818,7 @@ static void spoolss_notify_comment(int snum, SPOOL_NOTIFY_INFO_DATA *data, print
* jfm:xxxx incorrect, have to create a new smb.conf option
* location = "Room 1, floor 2, building 3"
********************************************************************/
-static void spoolss_notify_location(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_location(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(printer->info_2->location);
ascii_to_unistr(data->notify_data.data.string,
@@ -823,7 +830,7 @@ static void spoolss_notify_location(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
* fill a notify_info_data with the device mode
* jfm:xxxx don't to it for know but that's a real problem !!!
********************************************************************/
-static void spoolss_notify_devmode(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_devmode(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
}
@@ -832,7 +839,7 @@ static void spoolss_notify_devmode(int snum, SPOOL_NOTIFY_INFO_DATA *data, print
* jfm:xxxx just return no file could add an option to smb.conf
* separator file = "separator.txt"
********************************************************************/
-static void spoolss_notify_sepfile(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_sepfile(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(printer->info_2->sepfile);
ascii_to_unistr(data->notify_data.data.string,
@@ -844,7 +851,7 @@ static void spoolss_notify_sepfile(int snum, SPOOL_NOTIFY_INFO_DATA *data, print
* fill a notify_info_data with the print processor
* jfm:xxxx return always winprint to indicate we don't do anything to it
********************************************************************/
-static void spoolss_notify_print_processor(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_print_processor(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(printer->info_2->printprocessor);
ascii_to_unistr(data->notify_data.data.string,
@@ -856,7 +863,7 @@ static void spoolss_notify_print_processor(int snum, SPOOL_NOTIFY_INFO_DATA *dat
* fill a notify_info_data with the print processor options
* jfm:xxxx send an empty string
********************************************************************/
-static void spoolss_notify_parameters(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_parameters(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(printer->info_2->parameters);
ascii_to_unistr(data->notify_data.data.string,
@@ -868,7 +875,7 @@ static void spoolss_notify_parameters(int snum, SPOOL_NOTIFY_INFO_DATA *data, pr
* fill a notify_info_data with the data type
* jfm:xxxx always send RAW as data type
********************************************************************/
-static void spoolss_notify_datatype(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_datatype(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(printer->info_2->datatype);
ascii_to_unistr(data->notify_data.data.string,
@@ -881,7 +888,7 @@ static void spoolss_notify_datatype(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
* jfm:xxxx send an null pointer to say no security desc
* have to implement security before !
********************************************************************/
-static void spoolss_notify_security_desc(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_security_desc(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=0;
data->notify_data.data.string[0]=0x00;
@@ -891,7 +898,7 @@ static void spoolss_notify_security_desc(int snum, SPOOL_NOTIFY_INFO_DATA *data,
* fill a notify_info_data with the attributes
* jfm:xxxx a samba printer is always shared
********************************************************************/
-static void spoolss_notify_attributes(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_attributes(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0] = PRINTER_ATTRIBUTE_SHARED \
| PRINTER_ATTRIBUTE_NETWORK \
@@ -901,7 +908,7 @@ static void spoolss_notify_attributes(int snum, SPOOL_NOTIFY_INFO_DATA *data, pr
/*******************************************************************
* fill a notify_info_data with the priority
********************************************************************/
-static void spoolss_notify_priority(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_priority(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0] = printer->info_2->priority;
}
@@ -909,7 +916,7 @@ static void spoolss_notify_priority(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
/*******************************************************************
* fill a notify_info_data with the default priority
********************************************************************/
-static void spoolss_notify_default_priority(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_default_priority(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0] = printer->info_2->default_priority;
}
@@ -917,7 +924,7 @@ static void spoolss_notify_default_priority(int snum, SPOOL_NOTIFY_INFO_DATA *da
/*******************************************************************
* fill a notify_info_data with the start time
********************************************************************/
-static void spoolss_notify_start_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_start_time(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0] = printer->info_2->starttime;
}
@@ -925,7 +932,7 @@ static void spoolss_notify_start_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, pr
/*******************************************************************
* fill a notify_info_data with the until time
********************************************************************/
-static void spoolss_notify_until_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_until_time(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0] = printer->info_2->untiltime;
}
@@ -933,7 +940,7 @@ static void spoolss_notify_until_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, pr
/*******************************************************************
* fill a notify_info_data with the status
********************************************************************/
-static void spoolss_notify_status(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_status(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
int count;
print_queue_struct *q=NULL;
@@ -941,28 +948,30 @@ static void spoolss_notify_status(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_
bzero(&status,sizeof(status));
- count=get_printqueue(snum,0,&q,&status);
+ count=get_printqueue(snum, conn, &q, &status);
data->notify_data.value[0]=(uint32) status.status;
+ if (q) free(q);
}
/*******************************************************************
* fill a notify_info_data with the number of jobs queued
********************************************************************/
-static void spoolss_notify_cjobs(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_cjobs(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
print_queue_struct *q=NULL;
print_status_struct status;
bzero(&status,sizeof(status));
- data->notify_data.value[0]=get_printqueue(snum,0,&q,&status);
+ data->notify_data.value[0]=get_printqueue(snum, conn, &q, &status);
+ if (q) free(q);
}
/*******************************************************************
* fill a notify_info_data with the average ppm
********************************************************************/
-static void spoolss_notify_average_ppm(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_average_ppm(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
/* always respond 8 pages per minutes */
/* a little hard ! */
@@ -972,7 +981,7 @@ static void spoolss_notify_average_ppm(int snum, SPOOL_NOTIFY_INFO_DATA *data, p
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_username(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_username(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(queue->user);
ascii_to_unistr(data->notify_data.data.string, queue->user, sizeof(data->notify_data.data.string)-1);
@@ -981,7 +990,7 @@ static void spoolss_notify_username(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_job_status(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_job_status(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0]=queue->status;
}
@@ -989,7 +998,7 @@ static void spoolss_notify_job_status(int snum, SPOOL_NOTIFY_INFO_DATA *data, pr
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_job_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_job_name(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen(queue->file);
ascii_to_unistr(data->notify_data.data.string, queue->file, sizeof(data->notify_data.data.string)-1);
@@ -998,7 +1007,7 @@ static void spoolss_notify_job_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_job_status_string(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_job_status_string(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.data.length=strlen("En attente");
ascii_to_unistr(data->notify_data.data.string, "En attente", sizeof(data->notify_data.data.string)-1);
@@ -1007,7 +1016,7 @@ static void spoolss_notify_job_status_string(int snum, SPOOL_NOTIFY_INFO_DATA *d
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_job_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_job_time(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0]=0x0;
}
@@ -1015,7 +1024,7 @@ static void spoolss_notify_job_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_job_size(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_job_size(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0]=queue->size;
}
@@ -1023,7 +1032,7 @@ static void spoolss_notify_job_size(int snum, SPOOL_NOTIFY_INFO_DATA *data, prin
/*******************************************************************
* fill a notify_info_data with
********************************************************************/
-static void spoolss_notify_job_position(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
+static void spoolss_notify_job_position(connection_struct *conn, int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
data->notify_data.value[0]=queue->job;
}
@@ -1182,7 +1191,7 @@ static void construct_info_data(SPOOL_NOTIFY_INFO_DATA *info_data, uint16 type,
*
********************************************************************/
static void construct_notify_printer_info(SPOOL_NOTIFY_INFO *info, int pnum,
- int snum, int i, uint32 id)
+ int snum, int i, uint32 id, connection_struct *conn)
{
int k,j;
@@ -1215,7 +1224,7 @@ static void construct_notify_printer_info(SPOOL_NOTIFY_INFO *info, int pnum,
construct_info_data(info_data, type, field, id);
DEBUGADD(4,("notify_info_data_table: in\n"));
- notify_info_data_table[j].fn(snum, info_data, queue, &printer);
+ notify_info_data_table[j].fn(conn,snum, info_data, queue, &printer);
DEBUGADD(4,("notify_info_data_table: out\n"));
info->count++;
info_data=&(info->data[info->count]);
@@ -1232,7 +1241,7 @@ static void construct_notify_printer_info(SPOOL_NOTIFY_INFO *info, int pnum,
*
********************************************************************/
static void construct_notify_jobs_info(print_queue_struct *queue, SPOOL_NOTIFY_INFO *info,
- int pnum, int snum, int i, uint32 id)
+ int pnum, int snum, int i, uint32 id, connection_struct *conn)
{
int k,j;
@@ -1261,13 +1270,13 @@ static void construct_notify_jobs_info(print_queue_struct *queue, SPOOL_NOTIFY_I
DEBUGADD(4,("j=[%d]:%s\n", j, notify_info_data_table[j].name));
construct_info_data(info_data, type, field, id);
DEBUGADD(4,("notify_info_data_table: in\n"));
- notify_info_data_table[j].fn(snum, info_data, queue, &printer);
+ notify_info_data_table[j].fn(conn, snum, info_data, queue, &printer);
DEBUGADD(4,("notify_info_data_table: out\n"));
info->count++;
info_data=&(info->data[info->count]);
}
}
- free_a_printer(printer, 2);
+ free_a_printer(printer, 2);
}
}
@@ -1278,7 +1287,7 @@ static void construct_notify_jobs_info(print_queue_struct *queue, SPOOL_NOTIFY_I
* fill a notify_info struct with info asked
*
********************************************************************/
-static void printserver_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
+static void printserver_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info, connection_struct *conn)
{
int snum;
int pnum=find_printer_index_by_hnd(hnd);
@@ -1297,7 +1306,7 @@ static void printserver_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
{
if ( lp_browseable(snum) && lp_snum_ok(snum) && lp_print_ok(snum) )
{
- construct_notify_printer_info(info, pnum, snum, i, id);
+ construct_notify_printer_info(info, pnum, snum, i, id, conn);
id++;
}
}
@@ -1311,7 +1320,7 @@ static void printserver_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
* fill a notify_info struct with info asked
*
********************************************************************/
-static void printer_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
+static void printer_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info, connection_struct *conn)
{
int snum;
int pnum=find_printer_index_by_hnd(hnd);
@@ -1328,7 +1337,7 @@ static void printer_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
{
case PRINTER_NOTIFY_TYPE:
{
- construct_notify_printer_info(info, pnum, snum, i, id);
+ construct_notify_printer_info(info, pnum, snum, i, id, conn);
id--;
break;
}
@@ -1338,11 +1347,12 @@ static void printer_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
print_queue_struct *queue=NULL;
print_status_struct status;
bzero(&status, sizeof(status));
- count=get_printqueue(snum, 0, &queue, &status);
+ count=get_printqueue(snum, conn, &queue, &status);
for (j=0; j<count; j++)
{
- construct_notify_jobs_info(&(queue[j]), info, pnum, snum, i, queue[j].job);
+ construct_notify_jobs_info(&(queue[j]), info, pnum, snum, i, queue[j].job, conn);
}
+ if (queue) free(queue);
break;
}
}
@@ -1355,7 +1365,7 @@ static void printer_notify_info(PRINTER_HND *hnd, SPOOL_NOTIFY_INFO *info)
*
* called from api_spoolss_rfnpcnex (see this to understand)
********************************************************************/
-static void spoolss_reply_rfnpcnex(SPOOL_Q_RFNPCNEX *q_u, prs_struct *rdata)
+static void spoolss_reply_rfnpcnex(SPOOL_Q_RFNPCNEX *q_u, prs_struct *rdata, connection_struct *conn)
{
SPOOL_R_RFNPCNEX r_u;
int pnum=find_printer_index_by_hnd(&(q_u->handle));
@@ -1366,10 +1376,10 @@ static void spoolss_reply_rfnpcnex(SPOOL_Q_RFNPCNEX *q_u, prs_struct *rdata)
switch (Printer[pnum].printer_type)
{
case PRINTER_HANDLE_IS_PRINTSERVER:
- printserver_notify_info(&(q_u->handle), &(r_u.info));
+ printserver_notify_info(&(q_u->handle), &(r_u.info), conn);
break;
case PRINTER_HANDLE_IS_PRINTER:
- printer_notify_info(&(q_u->handle), &(r_u.info));
+ printer_notify_info(&(q_u->handle), &(r_u.info), conn);
break;
}
@@ -1383,21 +1393,21 @@ static void spoolss_reply_rfnpcnex(SPOOL_Q_RFNPCNEX *q_u, prs_struct *rdata)
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_rfnpcnex(uint16 vuid, prs_struct *data,
+static void api_spoolss_rfnpcnex(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_RFNPCNEX q_u;
spoolss_io_q_rfnpcnex("", &q_u, data, 0);
- spoolss_reply_rfnpcnex(&q_u,rdata);
+ spoolss_reply_rfnpcnex(&q_u, rdata, p->conn);
}
/********************************************************************
* construct_printer_info_0
* fill a printer_info_1 struct
********************************************************************/
-static void construct_printer_info_0(PRINTER_INFO_0 *printer,int snum, pstring servername)
+static void construct_printer_info_0(PRINTER_INFO_0 *printer,int snum, pstring servername, connection_struct *conn)
{
pstring chaine;
int count;
@@ -1405,7 +1415,7 @@ static void construct_printer_info_0(PRINTER_INFO_0 *printer,int snum, pstring s
print_queue_struct *queue=NULL;
print_status_struct status;
bzero(&status,sizeof(status));
- count=get_printqueue(snum,0,&queue,&status);
+ count=get_printqueue(snum, conn ,&queue,&status);
/* the description and the name are of the form \\server\share */
slprintf(chaine,sizeof(chaine)-1,"\\\\%s\\%s",servername, lp_servicename(snum));
@@ -1445,6 +1455,7 @@ static void construct_printer_info_0(PRINTER_INFO_0 *printer,int snum, pstring s
printer->unknown21 = 0x0648;
printer->unknown22 = 0x0;
printer->unknown23 = 0x5;
+ if (queue) free(queue);
}
@@ -1452,7 +1463,7 @@ static void construct_printer_info_0(PRINTER_INFO_0 *printer,int snum, pstring s
* construct_printer_info_1
* fill a printer_info_1 struct
********************************************************************/
-static BOOL construct_printer_info_1(PRINTER_INFO_1 *printer,int snum, pstring servername)
+static BOOL construct_printer_info_1(PRINTER_INFO_1 *printer,int snum, pstring servername, connection_struct *conn)
{
pstring chaine;
NT_PRINTER_INFO_LEVEL ntprinter;
@@ -1544,7 +1555,7 @@ static void construct_dev_mode(DEVICEMODE *devmode, int snum, char *servername)
* construct_printer_info_2
* fill a printer_info_2 struct
********************************************************************/
-static BOOL construct_printer_info_2(PRINTER_INFO_2 *printer, int snum, pstring servername)
+static BOOL construct_printer_info_2(PRINTER_INFO_2 *printer, int snum, pstring servername, connection_struct *conn)
{
pstring chaine;
int count;
@@ -1554,7 +1565,7 @@ static BOOL construct_printer_info_2(PRINTER_INFO_2 *printer, int snum, pstring
print_queue_struct *queue=NULL;
print_status_struct status;
bzero(&status, sizeof(status));
- count=get_printqueue(snum, 0, &queue, &status);
+ count=get_printqueue(snum, conn, &queue, &status);
if (get_a_printer(&ntprinter, 2, lp_servicename(snum)) !=0 )
{
@@ -1596,6 +1607,8 @@ static BOOL construct_printer_info_2(PRINTER_INFO_2 *printer, int snum, pstring
construct_dev_mode(devmode, snum, servername);
printer->devmode=devmode;
+ if (queue) free(queue);
+ free_a_printer(ntprinter, 2);
return (True);
}
@@ -1603,14 +1616,14 @@ static BOOL construct_printer_info_2(PRINTER_INFO_2 *printer, int snum, pstring
* enum_printer_info_1
* glue between spoolss_reply_enumprinters and construct_printer_info_1
********************************************************************/
-static BOOL enum_printer_info_1(PRINTER_INFO_1 **printer, int snum, int number)
+static BOOL enum_printer_info_1(PRINTER_INFO_1 **printer, int snum, int number, connection_struct *conn)
{
pstring servername;
*printer=(PRINTER_INFO_1 *)malloc(sizeof(PRINTER_INFO_1));
DEBUG(4,("Allocated memory for ONE PRINTER_INFO_1 at [%p]\n", *printer));
pstrcpy(servername, global_myname);
- if (!construct_printer_info_1(*printer, snum, servername))
+ if (!construct_printer_info_1(*printer, snum, servername, conn))
{
free(*printer);
return (False);
@@ -1625,14 +1638,14 @@ static BOOL enum_printer_info_1(PRINTER_INFO_1 **printer, int snum, int number)
* enum_printer_info_2
* glue between spoolss_reply_enumprinters and construct_printer_info_2
********************************************************************/
-static BOOL enum_printer_info_2(PRINTER_INFO_2 **printer, int snum, int number)
+static BOOL enum_printer_info_2(PRINTER_INFO_2 **printer, int snum, int number, connection_struct *conn)
{
pstring servername;
*printer=(PRINTER_INFO_2 *)malloc(sizeof(PRINTER_INFO_2));
DEBUG(4,("Allocated memory for ONE PRINTER_INFO_2 at [%p]\n", *printer));
pstrcpy(servername, global_myname);
- if (!construct_printer_info_2(*printer, snum, servername))
+ if (!construct_printer_info_2(*printer, snum, servername, conn))
{
free(*printer);
return (False);
@@ -1648,7 +1661,7 @@ static BOOL enum_printer_info_2(PRINTER_INFO_2 **printer, int snum, int number)
*
* called from api_spoolss_enumprinters (see this to understand)
********************************************************************/
-static void enum_all_printers_info_1(PRINTER_INFO_1 ***printers, uint32 *number)
+static void enum_all_printers_info_1(PRINTER_INFO_1 ***printers, uint32 *number, connection_struct *conn)
{
int snum;
int n_services=lp_numservices();
@@ -1662,7 +1675,7 @@ static void enum_all_printers_info_1(PRINTER_INFO_1 ***printers, uint32 *number)
DEBUG(4,("Found a printer: %s[%x]\n",lp_servicename(snum),snum));
*printers=Realloc(*printers, (*number+1)*sizeof(PRINTER_INFO_1 *));
DEBUG(4,("ReAlloced memory for [%d] PRINTER_INFO_1 pointers at [%p]\n", *number+1, *printers));
- if (enum_printer_info_1( &((*printers)[*number]), snum, *number) )
+ if (enum_printer_info_1( &((*printers)[*number]), snum, *number, conn) )
{
(*number)++;
}
@@ -1675,7 +1688,7 @@ static void enum_all_printers_info_1(PRINTER_INFO_1 ***printers, uint32 *number)
*
* called from api_spoolss_enumprinters (see this to understand)
********************************************************************/
-static void enum_all_printers_info_2(PRINTER_INFO_2 ***printers, uint32 *number)
+static void enum_all_printers_info_2(PRINTER_INFO_2 ***printers, uint32 *number, connection_struct *conn)
{
int snum;
int n_services=lp_numservices();
@@ -1689,7 +1702,7 @@ static void enum_all_printers_info_2(PRINTER_INFO_2 ***printers, uint32 *number)
DEBUG(4,("Found a printer: %s[%x]\n",lp_servicename(snum),snum));
*printers=Realloc(*printers, (*number+1)*sizeof(PRINTER_INFO_2 *));
DEBUG(4,("ReAlloced memory for [%d] PRINTER_INFO_1 pointers at [%p]\n", *number+1, *printers));
- if (enum_printer_info_2( &((*printers)[*number]), snum, *number) )
+ if (enum_printer_info_2( &((*printers)[*number]), snum, *number, conn) )
{
(*number)++;
}
@@ -1755,7 +1768,7 @@ static void free_enum_printers_info(SPOOL_R_ENUMPRINTERS *r_u)
*
* called from api_spoolss_enumprinters (see this to understand)
********************************************************************/
-static void spoolss_reply_enumprinters(SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *rdata)
+static void spoolss_reply_enumprinters(SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *rdata, connection_struct *conn)
{
SPOOL_R_ENUMPRINTERS r_u;
@@ -1770,14 +1783,14 @@ static void spoolss_reply_enumprinters(SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *rd
case 1:
if ( (q_u->flags==PRINTER_ENUM_NAME) || (q_u->flags==PRINTER_ENUM_NETWORK) )
/*if (is_a_printerserver(q_u->servername))*/
- enum_all_printers_info_1(&(r_u.printer.printers_1), &(r_u.returned) );
+ enum_all_printers_info_1(&(r_u.printer.printers_1), &(r_u.returned), conn );
/*else
enum_one_printer_info_1(&r_u);*/
break;
case 2:
if ( (q_u->flags==PRINTER_ENUM_NAME) || (q_u->flags==PRINTER_ENUM_NETWORK) )
/*if (is_a_printerserver(q_u->servername))*/
- enum_all_printers_info_2(&(r_u.printer.printers_2), &(r_u.returned) );
+ enum_all_printers_info_2(&(r_u.printer.printers_2), &(r_u.returned), conn );
/*else
enum_one_printer_info_2(&r_u);*/
break;
@@ -1803,20 +1816,20 @@ static void spoolss_reply_enumprinters(SPOOL_Q_ENUMPRINTERS *q_u, prs_struct *rd
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_enumprinters(uint16 vuid, prs_struct *data,
+static void api_spoolss_enumprinters(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENUMPRINTERS q_u;
spoolss_io_q_enumprinters("", &q_u, data, 0);
- spoolss_reply_enumprinters(&q_u,rdata);
+ spoolss_reply_enumprinters(&q_u, rdata, p->conn);
}
/****************************************************************************
****************************************************************************/
-static void spoolss_reply_getprinter(SPOOL_Q_GETPRINTER *q_u, prs_struct *rdata)
+static void spoolss_reply_getprinter(SPOOL_Q_GETPRINTER *q_u, prs_struct *rdata, connection_struct *conn)
{
SPOOL_R_GETPRINTER r_u;
int snum;
@@ -1834,7 +1847,7 @@ static void spoolss_reply_getprinter(SPOOL_Q_GETPRINTER *q_u, prs_struct *rdata)
printer=(PRINTER_INFO_0 *)malloc(sizeof(PRINTER_INFO_0));
- construct_printer_info_0(printer, snum, servername);
+ construct_printer_info_0(printer, snum, servername, conn);
r_u.printer.info0=printer;
r_u.status=0x0000;
r_u.offered=q_u->offered;
@@ -1852,7 +1865,7 @@ static void spoolss_reply_getprinter(SPOOL_Q_GETPRINTER *q_u, prs_struct *rdata)
printer=(PRINTER_INFO_1 *)malloc(sizeof(PRINTER_INFO_1));
- construct_printer_info_1(printer, snum, servername);
+ construct_printer_info_1(printer, snum, servername, conn);
r_u.printer.info1=printer;
r_u.status=0x0000;
@@ -1869,7 +1882,7 @@ static void spoolss_reply_getprinter(SPOOL_Q_GETPRINTER *q_u, prs_struct *rdata)
PRINTER_INFO_2 *printer;
printer=(PRINTER_INFO_2 *)malloc(sizeof(PRINTER_INFO_2));
- construct_printer_info_2(printer, snum, servername);
+ construct_printer_info_2(printer, snum, servername, conn);
r_u.printer.info2=printer;
r_u.status=0x0000;
@@ -1890,14 +1903,14 @@ static void spoolss_reply_getprinter(SPOOL_Q_GETPRINTER *q_u, prs_struct *rdata)
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_getprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_getprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_GETPRINTER q_u;
spoolss_io_q_getprinter("", &q_u, data, 0);
- spoolss_reply_getprinter(&q_u, rdata);
+ spoolss_reply_getprinter(&q_u, rdata, p->conn);
}
/********************************************************************
@@ -2103,7 +2116,7 @@ static void spoolss_reply_getprinterdriver2(SPOOL_Q_GETPRINTERDRIVER2 *q_u, prs_
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_getprinterdriver2(uint16 vuid, prs_struct *data,
+static void api_spoolss_getprinterdriver2(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_GETPRINTERDRIVER2 q_u;
@@ -2138,7 +2151,7 @@ static void spoolss_reply_startpageprinter(SPOOL_Q_STARTPAGEPRINTER *q_u, prs_st
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_startpageprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_startpageprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_STARTPAGEPRINTER q_u;
@@ -2173,7 +2186,7 @@ static void spoolss_reply_endpageprinter(SPOOL_Q_ENDPAGEPRINTER *q_u, prs_struct
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_endpageprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_endpageprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENDPAGEPRINTER q_u;
@@ -2208,7 +2221,7 @@ static void spoolss_reply_startdocprinter(SPOOL_Q_STARTDOCPRINTER *q_u, prs_stru
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_startdocprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_startdocprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_STARTDOCPRINTER q_u;
@@ -2275,7 +2288,7 @@ static void spoolss_reply_enddocprinter(SPOOL_Q_ENDDOCPRINTER *q_u, prs_struct *
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_enddocprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_enddocprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENDDOCPRINTER q_u;
@@ -2375,7 +2388,7 @@ static void spoolss_reply_writeprinter(SPOOL_Q_WRITEPRINTER *q_u, prs_struct *rd
* called from the spoolss dispatcher
*
********************************************************************/
-static void api_spoolss_writeprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_writeprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_WRITEPRINTER q_u;
@@ -2390,6 +2403,7 @@ static void api_spoolss_writeprinter(uint16 vuid, prs_struct *data,
{
fd=Printer[pnum].document_fd;
size=write(fd, q_u.buffer, q_u.buffer_size);
+ if (q_u.buffer) free(q_u.buffer);
Printer[pnum].document_lastwritten=size;
}
@@ -2401,31 +2415,25 @@ static void api_spoolss_writeprinter(uint16 vuid, prs_struct *data,
* called from the spoolss dispatcher
*
********************************************************************/
-static void control_printer(PRINTER_HND handle, uint32 command)
+static void control_printer(PRINTER_HND handle, uint32 command, connection_struct *conn)
{
int pnum;
int snum;
pnum = find_printer_index_by_hnd(&(handle));
if ( get_printer_snum(&handle, &snum) )
- {
- /*
- * status_printqueue requires a connection_struct
- *
- * anybody want to explain me what value it has here ???
- */
-
+ {
switch (command)
{
case PRINTER_CONTROL_PAUSE:
/* pause the printer here */
- status_printqueue(0, snum, LPSTAT_STOPPED);
+ status_printqueue(conn, snum, LPSTAT_STOPPED);
break;
case PRINTER_CONTROL_RESUME:
case PRINTER_CONTROL_UNPAUSE:
/* UN-pause the printer here */
- status_printqueue(0, snum, LPSTAT_OK);
+ status_printqueue(conn, snum, LPSTAT_OK);
break;
case PRINTER_CONTROL_PURGE:
/* Envoi des dragées FUCA dans l'imprimante */
@@ -2522,7 +2530,7 @@ static void spoolss_reply_setprinter(SPOOL_Q_SETPRINTER *q_u, prs_struct *rdata)
/****************************************************************************
****************************************************************************/
-static void api_spoolss_setprinter(uint16 vuid, prs_struct *data,
+static void api_spoolss_setprinter(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_SETPRINTER q_u;
@@ -2537,7 +2545,7 @@ static void api_spoolss_setprinter(uint16 vuid, prs_struct *data,
switch (q_u.level)
{
case 0:
- control_printer(q_u.handle, q_u.command);
+ control_printer(q_u.handle, q_u.command, p->conn);
break;
case 2:
update_printer(q_u.handle, q_u.level, q_u.info, q_u.devmode);
@@ -2560,7 +2568,7 @@ static void spoolss_reply_fcpn(SPOOL_Q_FCPN *q_u, prs_struct *rdata)
/****************************************************************************
****************************************************************************/
-static void api_spoolss_fcpn(uint16 vuid, prs_struct *data,
+static void api_spoolss_fcpn(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_FCPN q_u;
@@ -2583,7 +2591,7 @@ static void spoolss_reply_addjob(SPOOL_Q_ADDJOB *q_u, prs_struct *rdata)
/****************************************************************************
****************************************************************************/
-static void api_spoolss_addjob(uint16 vuid, prs_struct *data,
+static void api_spoolss_addjob(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ADDJOB q_u;
@@ -2665,7 +2673,7 @@ static void fill_job_info_2(JOB_INFO_2 *job_info, print_queue_struct *queue,
/****************************************************************************
****************************************************************************/
-static void spoolss_reply_enumjobs(SPOOL_Q_ENUMJOBS *q_u, prs_struct *rdata)
+static void spoolss_reply_enumjobs(SPOOL_Q_ENUMJOBS *q_u, prs_struct *rdata, connection_struct *conn)
{
SPOOL_R_ENUMJOBS r_u;
int snum;
@@ -2685,7 +2693,7 @@ static void spoolss_reply_enumjobs(SPOOL_Q_ENUMJOBS *q_u, prs_struct *rdata)
if (get_printer_snum(&(q_u->handle), &snum))
{
- count=get_printqueue(snum, 0, &queue, &status);
+ count=get_printqueue(snum, conn, &queue, &status);
r_u.numofjobs=count;
r_u.level=q_u->level;
@@ -2717,7 +2725,6 @@ static void spoolss_reply_enumjobs(SPOOL_Q_ENUMJOBS *q_u, prs_struct *rdata)
break;
}
}
-
}
r_u.status=0x0;
@@ -2736,18 +2743,20 @@ static void spoolss_reply_enumjobs(SPOOL_Q_ENUMJOBS *q_u, prs_struct *rdata)
break;
}
}
+ if (queue) free(queue);
+
}
/****************************************************************************
****************************************************************************/
-static void api_spoolss_enumjobs(uint16 vuid, prs_struct *data,
+static void api_spoolss_enumjobs(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENUMJOBS q_u;
spoolss_io_q_enumjobs("", &q_u, data, 0);
- spoolss_reply_enumjobs(&q_u, rdata);
+ spoolss_reply_enumjobs(&q_u, rdata, p->conn);
}
/****************************************************************************
@@ -2763,7 +2772,7 @@ static void spoolss_reply_schedulejob(SPOOL_Q_SCHEDULEJOB *q_u, prs_struct *rdat
/****************************************************************************
****************************************************************************/
-static void api_spoolss_schedulejob(uint16 vuid, prs_struct *data,
+static void api_spoolss_schedulejob(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_SCHEDULEJOB q_u;
@@ -2775,7 +2784,7 @@ static void api_spoolss_schedulejob(uint16 vuid, prs_struct *data,
/****************************************************************************
****************************************************************************/
-static void spoolss_reply_setjob(SPOOL_Q_SETJOB *q_u, prs_struct *rdata)
+static void spoolss_reply_setjob(SPOOL_Q_SETJOB *q_u, prs_struct *rdata, connection_struct *conn)
{
SPOOL_R_SETJOB r_u;
int snum;
@@ -2789,7 +2798,7 @@ static void spoolss_reply_setjob(SPOOL_Q_SETJOB *q_u, prs_struct *rdata)
if (get_printer_snum(&(q_u->handle), &snum))
{
- count=get_printqueue(snum, 0, &queue, &status);
+ count=get_printqueue(snum, conn, &queue, &status);
while ( (i<count) && found==False )
{
if ( q_u->jobid == queue[i].job )
@@ -2806,17 +2815,17 @@ static void spoolss_reply_setjob(SPOOL_Q_SETJOB *q_u, prs_struct *rdata)
case JOB_CONTROL_CANCEL:
case JOB_CONTROL_DELETE:
{
- del_printqueue(0, snum, q_u->jobid);
+ del_printqueue(conn, snum, q_u->jobid);
break;
}
case JOB_CONTROL_PAUSE:
{
- status_printjob(0, snum, q_u->jobid, LPQ_PAUSED);
+ status_printjob(conn, snum, q_u->jobid, LPQ_PAUSED);
break;
}
case JOB_CONTROL_RESUME:
{
- status_printjob(0, snum, q_u->jobid, LPQ_QUEUED);
+ status_printjob(conn, snum, q_u->jobid, LPQ_QUEUED);
break;
}
}
@@ -2824,23 +2833,25 @@ static void spoolss_reply_setjob(SPOOL_Q_SETJOB *q_u, prs_struct *rdata)
}
r_u.status=0x0;
spoolss_io_r_setjob("",&r_u,rdata,0);
+ if (queue) free(queue);
+
}
/****************************************************************************
****************************************************************************/
-static void api_spoolss_setjob(uint16 vuid, prs_struct *data,
+static void api_spoolss_setjob(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_SETJOB q_u;
spoolss_io_q_setjob("", &q_u, data, 0);
- spoolss_reply_setjob(&q_u, rdata);
+ spoolss_reply_setjob(&q_u, rdata, p->conn);
}
/****************************************************************************
****************************************************************************/
-static void spoolss_reply_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *rdata)
+static void spoolss_reply_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u, prs_struct *rdata, connection_struct *conn)
{
SPOOL_R_ENUMPRINTERDRIVERS r_u;
NT_PRINTER_DRIVER_INFO_LEVEL driver;
@@ -2857,7 +2868,7 @@ static void spoolss_reply_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u, pr
fstrcpy(servername, global_myname);
unistr2_to_ascii(architecture, &(q_u->environment), sizeof(architecture));
- count=get_ntdrivers(&list, architecture);
+ count=get_ntdrivers(conn, &list, architecture);
DEBUGADD(4,("we have: [%d] drivers on archi [%s]\n",count, architecture));
for (i=0; i<count; i++)
@@ -2939,14 +2950,14 @@ static void spoolss_reply_enumprinterdrivers(SPOOL_Q_ENUMPRINTERDRIVERS *q_u, pr
/****************************************************************************
****************************************************************************/
-static void api_spoolss_enumprinterdrivers(uint16 vuid, prs_struct *data,
+static void api_spoolss_enumprinterdrivers(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENUMPRINTERDRIVERS q_u;
spoolss_io_q_enumprinterdrivers("", &q_u, data, 0);
- spoolss_reply_enumprinterdrivers(&q_u, rdata);
+ spoolss_reply_enumprinterdrivers(&q_u, rdata, p->conn);
}
@@ -3014,7 +3025,7 @@ static void spoolss_reply_enumforms(SPOOL_Q_ENUMFORMS *q_u, prs_struct *rdata)
/****************************************************************************
****************************************************************************/
-static void api_spoolss_enumforms(uint16 vuid, prs_struct *data,
+static void api_spoolss_enumforms(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENUMFORMS q_u;
@@ -3082,7 +3093,7 @@ static void spoolss_reply_enumports(SPOOL_Q_ENUMPORTS *q_u, prs_struct *rdata)
/****************************************************************************
****************************************************************************/
-static void api_spoolss_enumports(uint16 vuid, prs_struct *data,
+static void api_spoolss_enumports(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENUMPORTS q_u;
@@ -3126,7 +3137,7 @@ static void spoolss_reply_addprinterex(SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *rd
/****************************************************************************
****************************************************************************/
-static void api_spoolss_addprinterex(uint16 vuid, prs_struct *data, prs_struct *rdata)
+static void api_spoolss_addprinterex(pipes_struct *p, prs_struct *data, prs_struct *rdata)
{
SPOOL_Q_ADDPRINTEREX q_u;
NT_PRINTER_INFO_LEVEL printer;
@@ -3163,7 +3174,7 @@ static void spoolss_reply_addprinterdriver(SPOOL_Q_ADDPRINTERDRIVER *q_u, prs_st
/****************************************************************************
****************************************************************************/
-static void api_spoolss_addprinterdriver(uint16 vuid, prs_struct *data,
+static void api_spoolss_addprinterdriver(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ADDPRINTERDRIVER q_u;
@@ -3206,7 +3217,7 @@ static void spoolss_reply_getprinterdriverdirectory(SPOOL_Q_GETPRINTERDRIVERDIR
/****************************************************************************
****************************************************************************/
-static void api_spoolss_getprinterdriverdirectory(uint16 vuid, prs_struct *data,
+static void api_spoolss_getprinterdriverdirectory(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_GETPRINTERDRIVERDIR q_u;
@@ -3312,7 +3323,7 @@ static void spoolss_reply_enumprinterdata(SPOOL_Q_ENUMPRINTERDATA *q_u, prs_stru
/****************************************************************************
****************************************************************************/
-static void api_spoolss_enumprinterdata(uint16 vuid, prs_struct *data,
+static void api_spoolss_enumprinterdata(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_ENUMPRINTERDATA q_u;
@@ -3358,7 +3369,7 @@ static void spoolss_reply_setprinterdata(SPOOL_Q_SETPRINTERDATA *q_u, prs_struct
/****************************************************************************
****************************************************************************/
-static void api_spoolss_setprinterdata(uint16 vuid, prs_struct *data,
+static void api_spoolss_setprinterdata(pipes_struct *p, prs_struct *data,
prs_struct *rdata)
{
SPOOL_Q_SETPRINTERDATA q_u;
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c
index dacef42121..5b43ec0303 100644
--- a/source3/rpc_server/srv_srvsvc.c
+++ b/source3/rpc_server/srv_srvsvc.c
@@ -909,7 +909,7 @@ static void srv_reply_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *q_n,
/*******************************************************************
********************************************************************/
-static void api_srv_net_srv_get_info( uint16 vuid, prs_struct *data,
+static void api_srv_net_srv_get_info( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SRV_Q_NET_SRV_GET_INFO q_n;
@@ -924,7 +924,7 @@ static void api_srv_net_srv_get_info( uint16 vuid, prs_struct *data,
/*******************************************************************
********************************************************************/
-static void api_srv_net_file_enum( uint16 vuid, prs_struct *data,
+static void api_srv_net_file_enum( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SRV_Q_NET_FILE_ENUM q_n;
@@ -942,7 +942,7 @@ static void api_srv_net_file_enum( uint16 vuid, prs_struct *data,
/*******************************************************************
********************************************************************/
-static void api_srv_net_conn_enum( uint16 vuid, prs_struct *data,
+static void api_srv_net_conn_enum( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SRV_Q_NET_CONN_ENUM q_n;
@@ -960,7 +960,7 @@ static void api_srv_net_conn_enum( uint16 vuid, prs_struct *data,
/*******************************************************************
********************************************************************/
-static void api_srv_net_sess_enum( uint16 vuid, prs_struct *data,
+static void api_srv_net_sess_enum( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SRV_Q_NET_SESS_ENUM q_n;
@@ -978,7 +978,7 @@ static void api_srv_net_sess_enum( uint16 vuid, prs_struct *data,
/*******************************************************************
********************************************************************/
-static void api_srv_net_share_enum( uint16 vuid, prs_struct *data,
+static void api_srv_net_share_enum( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SRV_Q_NET_SHARE_ENUM q_n;
@@ -1034,7 +1034,7 @@ static void srv_reply_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_n,
}
/*******************************************************************
********************************************************************/
-static void api_srv_net_remote_tod( uint16 vuid, prs_struct *data,
+static void api_srv_net_remote_tod( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SRV_Q_NET_REMOTE_TOD q_n;
diff --git a/source3/rpc_server/srv_svcctl.c b/source3/rpc_server/srv_svcctl.c
index 6a420c1493..39ec2c93ec 100644
--- a/source3/rpc_server/srv_svcctl.c
+++ b/source3/rpc_server/srv_svcctl.c
@@ -61,7 +61,7 @@ static void svc_reply_close(SVC_Q_CLOSE *q_r,
/*******************************************************************
api_svc_close
********************************************************************/
-static void api_svc_close( uint16 vuid, prs_struct *data,
+static void api_svc_close( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_CLOSE q_r;
@@ -117,7 +117,7 @@ static void svc_reply_open_service(SVC_Q_OPEN_SERVICE *q_u,
/*******************************************************************
api_svc_open_service
********************************************************************/
-static void api_svc_open_service( uint16 vuid, prs_struct *data,
+static void api_svc_open_service( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_OPEN_SERVICE q_u;
@@ -153,7 +153,7 @@ static void svc_reply_start_service(SVC_Q_START_SERVICE *q_s,
/*******************************************************************
api_svc_start_service
********************************************************************/
-static void api_svc_start_service( uint16 vuid, prs_struct *data,
+static void api_svc_start_service( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_START_SERVICE q_u;
@@ -203,7 +203,7 @@ static void svc_reply_open_sc_man(SVC_Q_OPEN_SC_MAN *q_u,
/*******************************************************************
api_svc_open_sc_man
********************************************************************/
-static void api_svc_open_sc_man( uint16 vuid, prs_struct *data,
+static void api_svc_open_sc_man( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_OPEN_SC_MAN q_u;
@@ -318,7 +318,7 @@ static void svc_reply_enum_svcs_status(SVC_Q_ENUM_SVCS_STATUS *q_u,
/*******************************************************************
api_svc_enum_svcs_status
********************************************************************/
-static void api_svc_enum_svcs_status( uint16 vuid, prs_struct *data,
+static void api_svc_enum_svcs_status( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_ENUM_SVCS_STATUS q_u;
@@ -356,7 +356,7 @@ static void svc_reply_query_disp_name(SVC_Q_QUERY_DISP_NAME *q_u,
/*******************************************************************
api_svc_query_disp_name
********************************************************************/
-static void api_svc_query_disp_name( uint16 vuid, prs_struct *data,
+static void api_svc_query_disp_name( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_QUERY_DISP_NAME q_u;
diff --git a/source3/rpc_server/srv_wkssvc.c b/source3/rpc_server/srv_wkssvc.c
index acb5cde831..9b0b0a3ca8 100644
--- a/source3/rpc_server/srv_wkssvc.c
+++ b/source3/rpc_server/srv_wkssvc.c
@@ -80,7 +80,7 @@ static void wks_reply_query_info(WKS_Q_QUERY_INFO *q_u,
/*******************************************************************
api_wks_query_info
********************************************************************/
-static void api_wks_query_info( uint16 vuid, prs_struct *data,
+static void api_wks_query_info( pipes_struct *p, prs_struct *data,
prs_struct *rdata )
{
WKS_Q_QUERY_INFO q_u;
diff --git a/source3/rpcclient/display.c b/source3/rpcclient/display.c
index 963b5b6249..dc801805c6 100644
--- a/source3/rpcclient/display.c
+++ b/source3/rpcclient/display.c
@@ -1827,6 +1827,82 @@ void display_at_job_info(FILE *out_hnd, enum action_type action,
}
}
+/****************************************************************************
+ display structure
+ ****************************************************************************/
+void display_eventlog_eventrecord(FILE *out_hnd, enum action_type action, EVENTLOGRECORD *ev)
+{
+ switch (action)
+ {
+ case ACTION_HEADER:
+ {
+ fprintf(out_hnd, "\tevent log records\n");
+ fprintf(out_hnd, "\t-----------------\n");
+ break;
+ }
+ case ACTION_ENUMERATE:
+ {
+ fstring temp;
+ fprintf(out_hnd, "\t\trecord n.:\t%d\n", ev->recordnumber);
+
+ fprintf(out_hnd, "\t\tsource\teventnumber\teventtype\tcategory\n");
+ unistr_to_ascii(temp, ev->sourcename.buffer, sizeof(temp)-1);
+
+ fprintf(out_hnd, "\t\t%s", temp);
+
+ fprintf(out_hnd, "\t%d\t\t", ev->eventnumber&0x0000FFFF);
+
+ switch (ev->eventtype)
+ {
+ case EVENTLOG_OK:
+ fprintf(out_hnd, "Normal");
+ break;
+
+ case EVENTLOG_ERROR:
+ fprintf(out_hnd, "Error");
+ break;
+
+ case EVENTLOG_WARNING:
+ fprintf(out_hnd, "Warning");
+ break;
+
+ case EVENTLOG_INFORMATION:
+ fprintf(out_hnd, "Information");
+ break;
+
+ case EVENTLOG_AUDIT_OK:
+ fprintf(out_hnd, "Audit Normal");
+ break;
+
+ case EVENTLOG_AUDIT_ERROR:
+ fprintf(out_hnd, "Audit Error\n");
+ break;
+ }
+
+ fprintf(out_hnd, "\t%d\n", ev->category);
+ fprintf(out_hnd, "\t\tcreationtime:\t%s\n", http_timestring(ev->creationtime));
+ fprintf(out_hnd, "\t\twritetime:\t%s\n", http_timestring(ev->writetime));
+
+ unistr_to_ascii(temp, ev->computername.buffer, sizeof(temp)-1);
+ fprintf(out_hnd, "\t\tcomputer:\t%s\n", temp);
+
+ if (ev->num_of_strings!=0)
+ {
+ unistr_to_ascii(temp, ev->strings.buffer, sizeof(temp)-1);
+ fprintf(out_hnd, "\t\tdescription:\t%s\n", temp);
+ }
+
+ fprintf(out_hnd, "\n");
+ break;
+ }
+ case ACTION_FOOTER:
+ {
+ fprintf(out_hnd, "\n");
+ break;
+ }
+ }
+}
+
#if COPY_THIS_TEMPLATE
/****************************************************************************
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 255ec4c936..9bfb80aa3d 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -105,6 +105,7 @@ struct
char *description;
} commands[] =
{
+ {"eventlog", cmd_eventlog, "list the events"},
{"svcenum", cmd_svc_enum, "[-i] Lists Services Manager"},
{"at", cmd_at, "Scheduler control (at /? for syntax)"},
{"time", cmd_time, "Display remote time"},