summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-24 22:20:30 +0100
committerGünther Deschner <gd@samba.org>2009-02-24 22:40:51 +0100
commite4c1841d1a0b9daa32901f1eb21a3dd504a7677c (patch)
tree600f7ac6e6a21e31254da0adaa7ea3fde2c9626f
parente4e1b1a0bb2ed333ed42e8cfab0349589a420029 (diff)
downloadsamba-e4c1841d1a0b9daa32901f1eb21a3dd504a7677c.tar.gz
samba-e4c1841d1a0b9daa32901f1eb21a3dd504a7677c.tar.bz2
samba-e4c1841d1a0b9daa32901f1eb21a3dd504a7677c.zip
s3-rpcclient: use rpccli_spoolss_getprinterdriver2 wrapper.
Guenther
-rw-r--r--source3/rpcclient/cmd_spoolss.c86
1 files changed, 78 insertions, 8 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index bb9d0e6d6c..99838f6396 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -989,6 +989,68 @@ static void display_print_driver_3(DRIVER_INFO_3 *i1)
/****************************************************************************
****************************************************************************/
+static void display_print_driver1(struct spoolss_DriverInfo1 *r)
+{
+ if (!r) {
+ return;
+ }
+
+ printf("Printer Driver Info 1:\n");
+ printf("\tDriver Name: [%s]\n\n", r->driver_name);
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_driver2(struct spoolss_DriverInfo2 *r)
+{
+ if (!r) {
+ return;
+ }
+
+ printf("Printer Driver Info 2:\n");
+ printf("\tVersion: [%x]\n", r->version);
+ printf("\tDriver Name: [%s]\n", r->driver_name);
+ printf("\tArchitecture: [%s]\n", r->architecture);
+ printf("\tDriver Path: [%s]\n", r->driver_path);
+ printf("\tDatafile: [%s]\n", r->data_file);
+ printf("\tConfigfile: [%s]\n\n", r->config_file);
+}
+
+/****************************************************************************
+****************************************************************************/
+
+static void display_print_driver3(struct spoolss_DriverInfo3 *r)
+{
+ int i;
+
+ if (!r) {
+ return;
+ }
+
+ printf("Printer Driver Info 3:\n");
+ printf("\tVersion: [%x]\n", r->version);
+ printf("\tDriver Name: [%s]\n", r->driver_name);
+ printf("\tArchitecture: [%s]\n", r->architecture);
+ printf("\tDriver Path: [%s]\n", r->driver_path);
+ printf("\tDatafile: [%s]\n", r->data_file);
+ printf("\tConfigfile: [%s]\n\n", r->config_file);
+ printf("\tHelpfile: [%s]\n\n", r->help_file);
+
+ for (i=0; r->dependent_files[i] != NULL; i++) {
+ printf("\tDependentfiles: [%s]\n", r->dependent_files[i]);
+ }
+
+ printf("\n");
+
+ printf("\tMonitorname: [%s]\n", r->monitor_name);
+ printf("\tDefaultdatatype: [%s]\n\n", r->default_datatype);
+}
+
+
+/****************************************************************************
+****************************************************************************/
+
static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
int argc, const char **argv)
@@ -997,10 +1059,12 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
WERROR werror;
uint32 info_level = 3;
bool opened_hnd = False;
- PRINTER_DRIVER_CTR ctr;
const char *printername;
uint32 i;
bool success = False;
+ union spoolss_DriverInfo info;
+ uint32_t server_major_version;
+ uint32_t server_minor_version;
if ((argc == 1) || (argc > 3))
{
@@ -1032,10 +1096,16 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
for (i=0; archi_table[i].long_archi!=NULL; i++) {
- werror = rpccli_spoolss_getprinterdriver( cli, mem_ctx, &pol, info_level,
- archi_table[i].long_archi, archi_table[i].version,
- &ctr);
-
+ werror = rpccli_spoolss_getprinterdriver2(cli, mem_ctx,
+ &pol,
+ archi_table[i].long_archi,
+ info_level,
+ 0, /* offered */
+ archi_table[i].version,
+ 2,
+ &info,
+ &server_major_version,
+ &server_minor_version);
if (!W_ERROR_IS_OK(werror))
continue;
@@ -1047,13 +1117,13 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
switch (info_level) {
case 1:
- display_print_driver_1 (ctr.info1);
+ display_print_driver1(&info.info1);
break;
case 2:
- display_print_driver_2 (ctr.info2);
+ display_print_driver2(&info.info2);
break;
case 3:
- display_print_driver_3 (ctr.info3);
+ display_print_driver3(&info.info3);
break;
default:
printf("unknown info level %d\n", info_level);