{
struct tevent_req *req, *subreq;
struct cli_read_andx_state *state;
- bool bigoffset = False;
uint8_t wct = 10;
if (size > cli_read_max_bufsize(cli)) {
SSVAL(state->vwv + 8, 0, 0);
SSVAL(state->vwv + 9, 0, 0);
- if ((uint64_t)offset >> 32) {
- bigoffset = true;
+ if (cli->capabilities & CAP_LARGE_FILES) {
SIVAL(state->vwv + 10, 0,
(((uint64_t)offset)>>32) & 0xffffffff);
- wct += 2;
+ wct = 12;
+ } else {
+ if ((((uint64_t)offset) & 0xffffffff00000000LL) != 0) {
+ DEBUG(10, ("cli_read_andx_send got large offset where "
+ "the server does not support it\n"));
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return tevent_req_post(req, ev);
+ }
}
subreq = cli_smb_req_create(state, ev, cli, SMBreadX, 0, wct,