Close a file.
****************************************************************************/
-struct cli_close_state {
+struct cli_smb1_close_state {
uint16_t vwv[3];
};
-static void cli_close_done(struct tevent_req *subreq);
+static void cli_smb1_close_done(struct tevent_req *subreq);
-struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
+struct tevent_req *cli_smb1_close_create(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
uint16_t fnum,
struct tevent_req **psubreq)
{
struct tevent_req *req, *subreq;
- struct cli_close_state *state;
+ struct cli_smb1_close_state *state;
- req = tevent_req_create(mem_ctx, &state, struct cli_close_state);
+ req = tevent_req_create(mem_ctx, &state, struct cli_smb1_close_state);
if (req == NULL) {
return NULL;
}
TALLOC_FREE(req);
return NULL;
}
- tevent_req_set_callback(subreq, cli_close_done, req);
+ tevent_req_set_callback(subreq, cli_smb1_close_done, req);
*psubreq = subreq;
return req;
}
+static void cli_smb1_close_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ NTSTATUS status;
+
+ status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+ tevent_req_done(req);
+}
+
struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
struct tevent_req *req, *subreq;
NTSTATUS status;
- req = cli_close_create(mem_ctx, ev, cli, fnum, &subreq);
+ req = cli_smb1_close_create(mem_ctx, ev, cli, fnum, &subreq);
if (req == NULL) {
return NULL;
}
return req;
}
-static void cli_close_done(struct tevent_req *subreq)
-{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- NTSTATUS status;
-
- status = cli_smb_recv(subreq, NULL, NULL, 0, NULL, NULL, NULL, NULL);
- TALLOC_FREE(subreq);
- if (tevent_req_nterror(req, status)) {
- return;
- }
- tevent_req_done(req);
-}
-
NTSTATUS cli_close_recv(struct tevent_req *req)
{
return tevent_req_simple_recv_ntstatus(req);
NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *fnum);
NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
-struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
+struct tevent_req *cli_smb1_close_create(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli, uint16_t fnum,
struct tevent_req **psubreq);
if (reqs[1] == NULL) return false;
tevent_req_set_callback(reqs[1], chain1_write_completion, NULL);
- reqs[2] = cli_close_create(talloc_tos(), evt, cli1, 0, &smbreqs[2]);
+ reqs[2] = cli_smb1_close_create(talloc_tos(), evt, cli1, 0, &smbreqs[2]);
if (reqs[2] == NULL) return false;
tevent_req_set_callback(reqs[2], chain1_close_completion, &done);