From 14591dc0eaa8751e8eb982d4157862e8ab8f2841 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 Mar 2004 07:11:13 +0000 Subject: fixed two writex client bugs - always use the 14 word writex varient even for small transfers as long as large offsets are negotiated (this matches windows behaviour) - make sure we fill in the top 16 bits of the count for large writex calls (This used to be commit 9ea20d0c9a1cb4800f3f54195cbbe70c98c8e423) --- source4/libcli/raw/rawreadwrite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/libcli/raw/rawreadwrite.c b/source4/libcli/raw/rawreadwrite.c index 84c7e3c00f..3aa95c35aa 100644 --- a/source4/libcli/raw/rawreadwrite.c +++ b/source4/libcli/raw/rawreadwrite.c @@ -40,7 +40,7 @@ struct cli_request *smb_raw_read_send(struct cli_tree *tree, union smb_read *par return NULL; case RAW_READ_READBRAW: - if (parms->readbraw.in.offset >= 0x80000000) { + if (tree->session->transport->negotiate.capabilities & CAP_LARGE_FILES) { bigoffset = True; } SETUP_REQUEST(SMBreadbraw, bigoffset? 10:8, 0); @@ -72,7 +72,7 @@ struct cli_request *smb_raw_read_send(struct cli_tree *tree, union smb_read *par break; case RAW_READ_READX: - if (parms->readx.in.offset >= 0x80000000) { + if (tree->session->transport->negotiate.capabilities & CAP_LARGE_FILES) { bigoffset = True; } SETUP_REQUEST(SMBreadX, bigoffset ? 12 : 10, 0); @@ -232,7 +232,7 @@ struct cli_request *smb_raw_write_send(struct cli_tree *tree, union smb_write *p break; case RAW_WRITE_WRITEX: - if (parms->writex.in.offset >= 0x80000000) { + if (tree->session->transport->negotiate.capabilities & CAP_LARGE_FILES) { bigoffset = True; } SETUP_REQUEST(SMBwriteX, bigoffset ? 14 : 12, parms->writex.in.count); @@ -243,7 +243,7 @@ struct cli_request *smb_raw_write_send(struct cli_tree *tree, union smb_write *p SIVAL(req->out.vwv, VWV(5), 0); /* reserved */ SSVAL(req->out.vwv, VWV(7), parms->writex.in.wmode); SSVAL(req->out.vwv, VWV(8), parms->writex.in.remaining); - SSVAL(req->out.vwv, VWV(9), 0); /* reserved */ + SSVAL(req->out.vwv, VWV(9), parms->writex.in.count>>16); SSVAL(req->out.vwv, VWV(10), parms->writex.in.count); SSVAL(req->out.vwv, VWV(11), PTR_DIFF(req->out.data, req->out.hdr)); if (bigoffset) { -- cgit