2 Unix SMB/CIFS implementation.
4 SMB2 client notify calls
6 Copyright (C) Stefan Metzmacher 2006
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "libcli/raw/libcliraw.h"
25 #include "libcli/smb2/smb2.h"
26 #include "libcli/smb2/smb2_calls.h"
31 NTSTATUS
smb2_cancel(struct smb2_request
*r
)
34 struct smb2_request
*c
;
39 * if we don't get a pending id yet, we just
40 * mark the request for pending, so that we directly
41 * send the cancel after getting the pending id
43 if (!r
->cancel
.can_cancel
) {
44 r
->cancel
.do_cancel
++;
48 /* we don't want a seqmun for a SMB2 Cancel */
49 old_seqnum
= r
->transport
->seqnum
;
50 c
= smb2_request_init(r
->transport
, SMB2_OP_CANCEL
, 0x04, False
, 0);
51 r
->transport
->seqnum
= old_seqnum
;
52 NT_STATUS_HAVE_NO_MEMORY(c
);
55 SIVAL(c
->out
.hdr
, SMB2_HDR_FLAGS
, 0x00000002);
56 SSVAL(c
->out
.hdr
, SMB2_HDR_UNKNOWN1
, 0x0030);
57 SIVAL(c
->out
.hdr
, SMB2_HDR_PID
, r
->cancel
.pending_id
);
58 SBVAL(c
->out
.hdr
, SMB2_HDR_SEQNUM
, c
->seqnum
);
60 SBVAL(c
->out
.hdr
, SMB2_HDR_UID
, r
->session
->uid
);
63 SSVAL(c
->out
.body
, 0x02, 0);
65 old_timeout
= c
->transport
->options
.timeout
;
66 c
->transport
->options
.timeout
= 0;
67 smb2_transport_send(c
);
68 c
->transport
->options
.timeout
= old_timeout
;
70 if (c
->state
== SMB2_REQUEST_ERROR
) {
73 status
= NT_STATUS_OK
;