diff options
author | Gerald Carter <jerry@samba.org> | 2002-08-19 21:17:22 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-08-19 21:17:22 +0000 |
commit | 11b71419b0bcefc90c1567f31268151aee81098c (patch) | |
tree | 234a41b453019950761c846dced32543a7506b5b /source3 | |
parent | cdf328bd3ca77ec6878d291cf7a4f37b8891133b (diff) | |
download | samba-11b71419b0bcefc90c1567f31268151aee81098c.tar.gz samba-11b71419b0bcefc90c1567f31268151aee81098c.tar.bz2 samba-11b71419b0bcefc90c1567f31268151aee81098c.zip |
add support for the "value,OID" format described in MSDN.
I've not seen this on a real network, but we support it now :-)
(This used to be commit 1ed6f68f6f29e1a62b12764ec5e84de8351efbd3)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index ae478d7c68..ae7cf2d953 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -7919,7 +7919,9 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u, Printer_entry *Printer = find_printer_index_by_hnd(p, handle); fstring valuename; fstring keyname; - + char *oid_string; + UNISTR2 uni_oid; + DEBUG(4,("_spoolss_setprinterdataex\n")); /* From MSDN documentation of SetPrinterDataEx: pass request to @@ -7953,11 +7955,39 @@ WERROR _spoolss_setprinterdataex(pipes_struct *p, SPOOL_Q_SETPRINTERDATAEX *q_u, unistr2_to_ascii( valuename, &q_u->value, sizeof(valuename) - 1); unistr2_to_ascii( keyname, &q_u->key, sizeof(keyname) - 1); + + /* check for OID in valuename */ + + if ( (oid_string = strchr( valuename, ',' )) != NULL ) + { + *oid_string = '\0'; + oid_string++; + } /* save the registry data */ status = set_printer_dataex( printer, keyname, valuename, type, data, real_len ); + + /* save the OID if one was specified and the previous set call succeeded */ + + if ( W_ERROR_IS_OK(status) && oid_string ) + { + fstrcat( keyname, "\\" ); + fstrcat( keyname, SPOOL_OID_KEY ); + + /* + * I'm not checking the status here on purpose. Don't know + * if this is right, but I'm returning the status from the + * previous set_printer_dataex() call. I have no idea if + * this is right. --jerry + */ + + init_unistr2( &uni_oid, oid_string, strlen(oid_string)+1 ); + set_printer_dataex( printer, keyname, valuename, + REG_SZ, (void*)uni_oid.buffer, uni_oid.uni_str_len*sizeof(uint16) ); + } + free_a_printer(&printer, 2); return status; |