summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2000-02-26 23:01:02 +0000
committerJean-François Micouleau <jfm@samba.org>2000-02-26 23:01:02 +0000
commitfd3acf437acb923757e1b59b503c864b4d1c45cc (patch)
tree74b937fdf141db10b6a0f6199c38da47b1fffb71 /source3/rpc_server
parentbadee62bca8b81db7ede74ac8ea7710b14a07b4c (diff)
downloadsamba-fd3acf437acb923757e1b59b503c864b4d1c45cc.tar.gz
samba-fd3acf437acb923757e1b59b503c864b4d1c45cc.tar.bz2
samba-fd3acf437acb923757e1b59b503c864b4d1c45cc.zip
added enumprintprocessordatatypes
now NT is happy and the "always send data in RAW mode" is checked J.F. (This used to be commit d7bcfe17cee64a513595d7c44456e93e88f2448b)
Diffstat (limited to 'source3/rpc_server')
-rwxr-xr-xsource3/rpc_server/srv_spoolss.c36
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c49
2 files changed, 85 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss.c b/source3/rpc_server/srv_spoolss.c
index d20f6c1616..75493b7a30 100755
--- a/source3/rpc_server/srv_spoolss.c
+++ b/source3/rpc_server/srv_spoolss.c
@@ -968,6 +968,41 @@ static BOOL api_spoolss_enumprintprocessors(uint16 vuid, prs_struct *data, prs_s
/****************************************************************************
****************************************************************************/
+static BOOL api_spoolss_enumprintprocdatatypes(uint16 vuid, prs_struct *data, prs_struct *rdata)
+{
+ SPOOL_Q_ENUMPRINTPROCDATATYPES q_u;
+ SPOOL_R_ENUMPRINTPROCDATATYPES r_u;
+
+ ZERO_STRUCT(q_u);
+ ZERO_STRUCT(r_u);
+
+ new_spoolss_allocate_buffer(&q_u.buffer);
+
+ if(!spoolss_io_q_enumprintprocdatatypes("", &q_u, data, 0)) {
+ DEBUG(0,("spoolss_io_q_enumprintprocdatatypes: unable to unmarshall SPOOL_Q_ENUMPRINTPROCDATATYPES.\n"));
+ return False;
+ }
+
+ /* that's an [in out] buffer */
+ new_spoolss_move_buffer(q_u.buffer, &r_u.buffer);
+
+ r_u.status = _spoolss_enumprintprocdatatypes(&q_u.name, &q_u.processor, q_u.level,
+ r_u.buffer, q_u.offered,
+ &r_u.needed, &r_u.returned);
+
+ if(!spoolss_io_r_enumprintprocdatatypes("", &r_u, rdata, 0)) {
+ DEBUG(0,("spoolss_io_r_enumprintprocdatatypes: unable to marshall SPOOL_R_ENUMPRINTPROCDATATYPES.\n"));
+ new_spoolss_free_buffer(q_u.buffer);
+ return False;
+ }
+
+ new_spoolss_free_buffer(q_u.buffer);
+
+ return True;
+}
+
+/****************************************************************************
+****************************************************************************/
static BOOL api_spoolss_enumprintmonitors(uint16 vuid, prs_struct *data, prs_struct *rdata)
{
SPOOL_Q_ENUMPRINTMONITORS q_u;
@@ -1069,6 +1104,7 @@ struct api_struct api_spoolss_cmds[] =
{"SPOOLSS_ENUMPRINTPROCESSORS", SPOOLSS_ENUMPRINTPROCESSORS, api_spoolss_enumprintprocessors },
{"SPOOLSS_ENUMMONITORS", SPOOLSS_ENUMMONITORS, api_spoolss_enumprintmonitors },
{"SPOOLSS_GETJOB", SPOOLSS_GETJOB, api_spoolss_getjob },
+ {"SPOOLSS_ENUMPRINTPROCDATATYPES", SPOOLSS_ENUMPRINTPROCDATATYPES, api_spoolss_enumprintprocdatatypes },
{ NULL, 0, NULL }
};
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 3ab426e9c2..90a0ef6d60 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -3849,7 +3849,56 @@ uint32 _spoolss_enumprintprocessors(UNISTR2 *name, UNISTR2 *environment, uint32
return NT_STATUS_INVALID_INFO_CLASS;
break;
}
+}
+
+/****************************************************************************
+ enumprintprocdatatypes level 1.
+****************************************************************************/
+static uint32 enumprintprocdatatypes_level_1(NEW_BUFFER *buffer, uint32 offered, uint32 *needed, uint32 *returned)
+{
+ PRINTPROCDATATYPE_1 *info_1=NULL;
+
+ info_1 = (PRINTPROCDATATYPE_1 *)malloc(sizeof(PRINTPROCDATATYPE_1));
+ (*returned) = 0x1;
+
+ init_unistr(&(info_1->name), "RAW");
+
+ *needed += spoolss_size_printprocdatatype_info_1(info_1);
+
+ if (!alloc_buffer_size(buffer, *needed))
+ return ERROR_INSUFFICIENT_BUFFER;
+
+ smb_io_printprocdatatype_info_1("", buffer, info_1, 0);
+
+ safe_free(info_1);
+
+ if (*needed > offered) {
+ *returned=0;
+ return ERROR_INSUFFICIENT_BUFFER;
+ }
+ else
+ return NT_STATUS_NO_PROBLEMO;
+}
+/****************************************************************************
+****************************************************************************/
+uint32 _spoolss_enumprintprocdatatypes(UNISTR2 *name, UNISTR2 *processor, uint32 level,
+ NEW_BUFFER *buffer, uint32 offered,
+ uint32 *needed, uint32 *returned)
+{
+ DEBUG(5,("_spoolss_enumprintprocdatatypes\n"));
+
+ *returned=0;
+ *needed=0;
+
+ switch (level) {
+ case 1:
+ return enumprintprocdatatypes_level_1(buffer, offered, needed, returned);
+ break;
+ default:
+ return NT_STATUS_INVALID_INFO_CLASS;
+ break;
+ }
}
/****************************************************************************