diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-30 21:47:20 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-30 21:47:20 +0000 |
commit | d4959bdbdc103be5133993c05c8d7c6ab4f5318a (patch) | |
tree | 783b6b6576a697b1cc536e36c0875ab2e306bf51 | |
parent | dc0b638489fbcf256453d821449403d6d8395b41 (diff) | |
download | samba-d4959bdbdc103be5133993c05c8d7c6ab4f5318a.tar.gz samba-d4959bdbdc103be5133993c05c8d7c6ab4f5318a.tar.bz2 samba-d4959bdbdc103be5133993c05c8d7c6ab4f5318a.zip |
Only use prs_uint8s on marshalling as we know we're little endian. On
unmarshalling use prs_uint16s. Yes this sucks :-).
Jeremy.
(This used to be commit 3d68257850be66c26074a43d92eb9c3c8ffaf04e)
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index ac10f37646..eaacb52f5b 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -382,9 +382,14 @@ BOOL smb_io_notify_info_data_strings(char *desc,SPOOL_NOTIFY_INFO_DATA *data, x=data->notify_data.data.length+1; if(!prs_uint32("string length", ps, depth, &x )) return False; - /* These are already in little endian format. Don't byte swap. */ - if(!prs_uint8s(True,"string",ps,depth,(uint8 *)data->notify_data.data.string,x*2)) - return False; + if (MARSHALLING(ps)) { + /* These are already in little endian format. Don't byte swap. */ + if(!prs_uint8s(True,"string",ps,depth,(uint8 *)data->notify_data.data.string,x*2)) + return False; + } else { + if(!prs_uint16s(True,"string",ps,depth,data->notify_data.data.string,x)) + return False; + } } if(!prs_align(ps)) return False; @@ -4775,7 +4780,7 @@ BOOL uni_2_asc_printer_driver_3(SPOOL_PRINTER_DRIVER_INFO_LEVEL_3 *uni, DEBUGADD(8,( "monitorname: %s\n", d->monitorname)); DEBUGADD(8,( "defaultdatatype: %s\n", d->defaultdatatype)); - uniarray_2_dosarray(&(uni->dependentfiles), &(d->dependentfiles) ); + uniarray_2_dosarray(&uni->dependentfiles, &d->dependentfiles ); return True; } @@ -5172,8 +5177,15 @@ BOOL spoolss_io_r_enumprinterdata(char *desc, SPOOL_R_ENUMPRINTERDATA *r_u, prs_ return False; if(!prs_uint32("valuesize", ps, depth, &r_u->valuesize)) return False; - if(!prs_uint16s(False, "value", ps, depth, r_u->value, r_u->valuesize)) - return False; + + if (MARSHALLING(ps)) { + /* "Value is actually a UNICODE string. It's already little-endian so don't reverse. */ + if(!prs_uint8s(False, "value", ps, depth, (uint8 *)r_u->value, r_u->valuesize * 2)) + return False; + } else { + if(!prs_uint16s(False, "value", ps, depth, r_u->value, r_u->valuesize )) + return False; + } if(!prs_align(ps)) return False; |