summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-09-09 00:19:35 +0000
committerJeremy Allison <jra@samba.org>2000-09-09 00:19:35 +0000
commite0f9de0c49dde82610b0da406b4685e787f69725 (patch)
tree3effbc84094e2fb2f5dcfad07d587e97e4f20126 /source3/rpc_parse
parent588d802877ec5c1969d8f0a79875382bfa91c032 (diff)
downloadsamba-e0f9de0c49dde82610b0da406b4685e787f69725.tar.gz
samba-e0f9de0c49dde82610b0da406b4685e787f69725.tar.bz2
samba-e0f9de0c49dde82610b0da406b4685e787f69725.zip
Implemented DELETEPRINTERDATA (tested with Gerald's Win32 progs).
Jeremy. (This used to be commit fb48efaf830626f6ef05b88f5f8a74b932ceb257)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_spoolss.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 3b0ddaac9f..953124ebe4 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -954,7 +954,8 @@ BOOL make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u,
********************************************************************/
BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_struct *ps, int depth)
{
- if (q_u == NULL) return False;
+ if (q_u == NULL)
+ return False;
prs_debug(ps, depth, desc, "spoolss_io_q_getprinterdata");
depth++;
@@ -976,6 +977,44 @@ BOOL spoolss_io_q_getprinterdata(char *desc, SPOOL_Q_GETPRINTERDATA *q_u, prs_st
}
/*******************************************************************
+ * read a structure.
+ * called from spoolss_q_deleteprinterdata (srv_spoolss.c)
+ ********************************************************************/
+BOOL spoolss_io_q_deleteprinterdata(char *desc, SPOOL_Q_DELETEPRINTERDATA *q_u, prs_struct *ps, int depth)
+{
+ if (q_u == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "spoolss_io_q_deleteprinterdata");
+ depth++;
+
+ if (!prs_align(ps))
+ return False;
+ if (!smb_io_pol_hnd("printer handle",&(q_u->handle),ps,depth))
+ return False;
+ if (!prs_align(ps))
+ return False;
+ if (!smb_io_unistr2("valuename", &(q_u->valuename),True,ps,depth))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
+ * write a structure.
+ * called from spoolss_r_deleteprinterdata (srv_spoolss.c)
+ ********************************************************************/
+BOOL spoolss_io_r_deleteprinterdata(char *desc, SPOOL_R_DELETEPRINTERDATA *r_u, prs_struct *ps, int depth)
+{
+ prs_debug(ps, depth, desc, "spoolss_io_r_deleteprinterdata");
+ depth++;
+ if(!prs_uint32("status", ps, depth, &r_u->status))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
* write a structure.
* called from spoolss_r_getprinterdata (srv_spoolss.c)
********************************************************************/
@@ -5167,11 +5206,12 @@ BOOL convert_specific_param(NT_PRINTER_PARAM **param, const UNISTR2 *value,
(*param)->data_len=len;
- (*param)->data=(uint8 *)malloc(len * sizeof(uint8));
- if((*param)->data == NULL)
- return False;
-
- memcpy((*param)->data, data, len);
+ if (len) {
+ (*param)->data=(uint8 *)malloc(len * sizeof(uint8));
+ if((*param)->data == NULL)
+ return False;
+ memcpy((*param)->data, data, len);
+ }
DEBUGADD(6,("\tvalue:[%s], len:[%d]\n",(*param)->value, (*param)->data_len));