struct tevent_req *smb2cli_create_send(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct cli_state *cli,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
const char *filename,
uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
data_blob_free(&blob);
}
- subreq = smb2cli_req_send(state, ev, cli->conn, SMB2_OP_CREATE,
+ subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_CREATE,
0, 0, /* flags */
- cli->timeout,
- cli->smb2.pid,
- cli->smb2.tid,
- cli->smb2.session,
+ timeout_msec,
+ 0xFEFF, /* pid */
+ tcon_id,
+ session,
state->fixed, sizeof(state->fixed),
dyn, dyn_len);
if (tevent_req_nomem(subreq, req)) {
return NT_STATUS_OK;
}
-NTSTATUS smb2cli_create(struct cli_state *cli,
+NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
const char *filename,
uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(conn)) {
/*
* Can't use sync call while an async call is in flight
*/
if (ev == NULL) {
goto fail;
}
- req = smb2cli_create_send(frame, ev, cli, filename, oplock_level,
+ req = smb2cli_create_send(frame, ev, conn, timeout_msec, session,
+ tcon_id, filename, oplock_level,
impersonation_level, desired_access,
file_attributes, share_access,
create_disposition, create_options,
return false;
}
- status = smb2cli_create(cli, "smb2-basic.txt",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "smb2-basic.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli, "",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_SYNCHRONIZE|
return false;
}
- status = smb2cli_create(cli1, "session-reconnect.txt",
+ status = smb2cli_create(cli1->conn, cli1->timeout, cli1->smb2.session,
+ cli1->smb2.tid, "session-reconnect.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli2, "session-reconnect.txt",
+ status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
+ cli2->smb2.tid, "session-reconnect.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli2, "session-reconnect.txt",
+ status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
+ cli2->smb2.tid, "session-reconnect.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli2, "session-reconnect.txt",
+ status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
+ cli2->smb2.tid, "session-reconnect.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli, "tcon_depedence.txt",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "tcon_depedence.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
cli3->smb2.tid = cli2->smb2.tid;
- status = smb2cli_create(cli2, "multi-channel.txt",
+ status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
+ cli2->smb2.tid, "multi-channel.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli1, "multi-channel-invalid.txt",
+ status = smb2cli_create(cli1->conn, cli1->timeout, cli1->smb2.session,
+ cli1->smb2.tid, "multi-channel-invalid.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli2, "multi-channel-invalid.txt",
+ status = smb2cli_create(cli2->conn, cli2->timeout, cli2->smb2.session,
+ cli2->smb2.tid, "multi-channel-invalid.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli3, "multi-channel-invalid.txt",
+ status = smb2cli_create(cli3->conn, cli3->timeout, cli3->smb2.session,
+ cli3->smb2.tid, "multi-channel-invalid.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli, "session-reauth.txt",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "session-reauth.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli, "",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_SYNCHRONIZE|
return false;
}
- status = smb2cli_create(cli, "session-reauth-invalid.txt",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "session-reauth-invalid.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */
return false;
}
- status = smb2cli_create(cli, "",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_SYNCHRONIZE|
return false;
}
- status = smb2cli_create(cli, "session-reauth.txt",
+ status = smb2cli_create(cli->conn, cli->timeout, cli->smb2.session,
+ cli->smb2.tid, "session-reauth.txt",
SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
SEC_STD_ALL | SEC_FILE_ALL, /* desired_access, */