static NTSTATUS map_fnum_to_smb2_handle(struct cli_state *cli,
uint16_t fnum, /* In */
- struct smb2_hnd **pph) /* Out */
+ const struct smb2_hnd **pph) /* Out */
{
struct idr_context *idp = cli->smb2.open_handles;
void *ph = NULL;
***************************************************************/
static NTSTATUS delete_smb2_handle_mapping(struct cli_state *cli,
- struct smb2_hnd **pph, /* In */
+ const struct smb2_hnd **pph, /* In */
uint16_t fnum) /* In */
{
struct idr_context *idp = cli->smb2.open_handles;
return NT_STATUS_INVALID_PARAMETER;
}
idr_remove(idp, fnum);
- TALLOC_FREE(*pph);
+ TALLOC_FREE(ph);
+ *pph = NULL;
return NT_STATUS_OK;
}
bool cli_smb2_fnum_is_posix(struct cli_state *cli, uint16_t fnum)
{
- struct smb2_hnd *ph = NULL;
+ const struct smb2_hnd *ph = NULL;
NTSTATUS status;
status = map_fnum_to_smb2_handle(cli, fnum, &ph);
struct cli_smb2_close_fnum_state {
struct cli_state *cli;
uint16_t fnum;
- struct smb2_hnd *ph;
+ const struct smb2_hnd *ph;
};
static void cli_smb2_close_fnum_done(struct tevent_req *subreq);
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_smb2_set_info_fnum_state *state = NULL;
- struct smb2_hnd *ph = NULL;
+ const struct smb2_hnd *ph = NULL;
NTSTATUS status;
req = tevent_req_create(
if (response == NULL) {
struct tevent_req *subreq = NULL;
struct cli_state *cli = state->cli;
- struct smb2_hnd *ph = NULL;
+ const struct smb2_hnd *ph = NULL;
uint32_t max_trans, max_avail_len;
bool ok;
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_smb2_query_info_fnum_state *state = NULL;
- struct smb2_hnd *ph = NULL;
+ const struct smb2_hnd *ph = NULL;
NTSTATUS status;
req = tevent_req_create(
struct cli_smb2_read_state {
struct tevent_context *ev;
struct cli_state *cli;
- struct smb2_hnd *ph;
+ const struct smb2_hnd *ph;
uint64_t start_offset;
uint32_t size;
uint32_t received;
struct cli_smb2_write_state {
struct tevent_context *ev;
struct cli_state *cli;
- struct smb2_hnd *ph;
+ const struct smb2_hnd *ph;
uint32_t flags;
const uint8_t *buf;
uint64_t offset;
struct cli_smb2_writeall_state {
struct tevent_context *ev;
struct cli_state *cli;
- struct smb2_hnd *ph;
+ const struct smb2_hnd *ph;
uint32_t flags;
const uint8_t *buf;
uint64_t offset;
struct cli_smb2_splice_state {
struct tevent_context *ev;
struct cli_state *cli;
- struct smb2_hnd *src_ph;
- struct smb2_hnd *dst_ph;
+ const struct smb2_hnd *src_ph;
+ const struct smb2_hnd *dst_ph;
int (*splice_cb)(off_t n, void *priv);
void *priv;
off_t written;
struct cli_smb2_shadow_copy_data_fnum_state {
struct cli_state *cli;
uint16_t fnum;
- struct smb2_hnd *ph;
+ const struct smb2_hnd *ph;
DATA_BLOB out_input_buffer;
DATA_BLOB out_output_buffer;
};
{
struct tevent_req *req = NULL;
struct cli_smb2_notify_state *state = NULL;
- struct smb2_hnd *ph = NULL;
+ const struct smb2_hnd *ph = NULL;
NTSTATUS status;
req = tevent_req_create(mem_ctx, &state,
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_smb2_fsctl_state *state = NULL;
- struct smb2_hnd *ph = NULL;
+ const struct smb2_hnd *ph = NULL;
NTSTATUS status;
req = tevent_req_create(mem_ctx, &state, struct cli_smb2_fsctl_state);