diff options
author | Gerald Carter <jerry@samba.org> | 2003-09-09 04:07:32 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-09-09 04:07:32 +0000 |
commit | 4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8 (patch) | |
tree | dd0a9f32d9933e1f75d919b5083e007d7453f9c4 /source3/rpcclient/cmd_spoolss.c | |
parent | 3d7cb49747a9a7f5cdec0ee05c6270ec3604202f (diff) | |
download | samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.gz samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.bz2 samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.zip |
sync 3.0 into HEAD for the last time
(This used to be commit c17a7dc9a190156a069da3e861c18fd3f81224ad)
Diffstat (limited to 'source3/rpcclient/cmd_spoolss.c')
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index b2fa802e9a..61e100c03b 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -35,6 +35,7 @@ static const struct table_node archi_table[]= { {"Windows 4.0", "WIN40", 0 }, {"Windows NT x86", "W32X86", 2 }, + {"Windows NT x86", "W32X86", 3 }, {"Windows NT R4000", "W32MIPS", 2 }, {"Windows NT Alpha_AXP", "W32ALPHA", 2 }, {"Windows NT PowerPC", "W32PPC", 2 }, @@ -395,7 +396,31 @@ static void display_port_info_2(PORT_INFO_2 *i2) rpcstr_pull(buffer, i2->description.buffer, sizeof(buffer), -1, STR_TERMINATE); printf("\tDescription:\t[%s]\n", buffer); - printf("\tPort Type:\t[%d]\n", i2->port_type); + printf("\tPort Type:\t" ); + if ( i2->port_type ) { + int comma = 0; /* hack */ + printf( "[" ); + if ( i2->port_type & PORT_TYPE_READ ) { + printf( "Read" ); + comma = 1; + } + if ( i2->port_type & PORT_TYPE_WRITE ) { + printf( "%sWrite", comma ? ", " : "" ); + comma = 1; + } + /* These two have slightly different interpretations + on 95/98/ME but I'm disregarding that for now */ + if ( i2->port_type & PORT_TYPE_REDIRECTED ) { + printf( "%sRedirected", comma ? ", " : "" ); + comma = 1; + } + if ( i2->port_type & PORT_TYPE_NET_ATTACHED ) { + printf( "%sNet-Attached", comma ? ", " : "" ); + } + printf( "]\n" ); + } else { + printf( "[Unset]\n" ); + } printf("\tReserved:\t[%d]\n", i2->reserved); printf("\n"); } @@ -912,6 +937,7 @@ static WERROR cmd_spoolss_getdriver(struct cli_state *cli, servername, user; uint32 i; + BOOL success = False; if ((argc == 1) || (argc > 3)) { @@ -947,15 +973,22 @@ static WERROR cmd_spoolss_getdriver(struct cli_state *cli, werror = cli_spoolss_getprinterdriver( cli, mem_ctx, 0, &needed, &pol, info_level, - archi_table[i].long_archi, &ctr); + archi_table[i].long_archi, archi_table[i].version, + &ctr); - if (W_ERROR_V(werror) == ERRinsufficientbuffer) + if (W_ERROR_V(werror) == ERRinsufficientbuffer) { werror = cli_spoolss_getprinterdriver( cli, mem_ctx, needed, NULL, &pol, info_level, - archi_table[i].long_archi, &ctr); + archi_table[i].long_archi, archi_table[i].version, + &ctr); + } if (!W_ERROR_IS_OK(werror)) continue; + + /* need at least one success */ + + success = True; printf ("\n[%s]\n", archi_table[i].long_archi); @@ -980,6 +1013,9 @@ static WERROR cmd_spoolss_getdriver(struct cli_state *cli, if (opened_hnd) cli_spoolss_close_printer (cli, mem_ctx, &pol); + if ( success ) + werror = WERR_OK; + return werror; } |