summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2000-08-04 12:46:36 +0000
committerGerald Carter <jerry@samba.org>2000-08-04 12:46:36 +0000
commit4003a1c55bda51fa418ec7c077bfad775ac88ba5 (patch)
tree1ef984627787836e253cdbede8c9b5551210158a /source3/rpcclient
parent394795e28b00eb95759938770cd24ee7c75ed39d (diff)
downloadsamba-4003a1c55bda51fa418ec7c077bfad775ac88ba5.tar.gz
samba-4003a1c55bda51fa418ec7c077bfad775ac88ba5.tar.bz2
samba-4003a1c55bda51fa418ec7c077bfad775ac88ba5.zip
clunky support for calling AddPrinterEx(). The code currently reports
that the call failed, but the printer shows up on the remote NT client. (note this is the client side call). I've botched the return value somewhere and will fix that today. jerry (This used to be commit e15d9befd24cf5f3410c4be819b2a1fcf68048fb)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 5a614a38b5..058c6db457 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -512,6 +512,7 @@ uint32 cmd_spoolss_addprinterex(struct client_info *info, int argc, char *argv[]
fstring srv_port_name;
BOOL valid_port = False;
TALLOC_CTX *mem_ctx = NULL;
+ uint32 result;
fstrcpy(srv_name, "\\\\");
fstrcat(srv_name, info->dest_host);
@@ -589,21 +590,22 @@ uint32 cmd_spoolss_addprinterex(struct client_info *info, int argc, char *argv[]
* Need to build the PRINTER_INFO_2 struct here.
* I think it would be better only to deal with a PRINTER_INFO_2
* and the abstract the creation of a SPOOL_PRINTER_INFO_LEVEL_2
- * from that rather than dealing with the struct passed dircetly
+ * from that rather than dealing with the struct passed directly
* on the wire. We don't need the extra *_ptr fields, etc...
* here anyways. --jerry
*/
- init_unistr( &print_info_2.servername, srv_name);
+ ZERO_STRUCTP(&print_info_2);
+ /* init_unistr( &print_info_2.servername, srv_name); */
init_unistr( &print_info_2.printername, printer_name);
- init_unistr( &print_info_2.sharename, printer_name);
+ /* init_unistr( &print_info_2.sharename, share_name); */
init_unistr( &print_info_2.portname, port_name);
init_unistr( &print_info_2.drivername, driver_name);
init_unistr( &print_info_2.comment, "Created by rpcclient");
- init_unistr( &print_info_2.location, "");
- init_unistr (&print_info_2.sepfile, "");
+ /* init_unistr( &print_info_2.location, "");
+ init_unistr( &print_info_2.sepfile, ""); */
init_unistr( &print_info_2.printprocessor, "winprint");
init_unistr( &print_info_2.datatype, "RAW");
- init_unistr( &print_info_2.parameters, "");
+ /* init_unistr( &print_info_2.parameters, ""); */
print_info_2.devmode = NULL;
print_info_2.secdesc = NULL;
print_info_2.attributes = 0;
@@ -618,7 +620,7 @@ uint32 cmd_spoolss_addprinterex(struct client_info *info, int argc, char *argv[]
/* if successful, spoolss_addprinterex() should return True and hnd
should be a valid handle to an open printer */
- if (spoolss_addprinterex(&hnd, &print_info_2))
+ if ((result = spoolss_addprinterex(&hnd, srv_name, &print_info_2)) == NT_STATUS_NOPROBLEMO)
{
if (!spoolss_closeprinter( &hnd ))
{
@@ -627,7 +629,7 @@ uint32 cmd_spoolss_addprinterex(struct client_info *info, int argc, char *argv[]
}
else
{
- report (out_hnd, "cmd_spoolss_addprinterex: spoolss_addprinterex FAILED!\n");
+ report (out_hnd, "cmd_spoolss_addprinterex: spoolss_addprinterex FAILED! [%d]\n", result);
}