mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
s3-libsmb: introduce new NTSTATUS cli_read()
Replacement for cli_read_old() Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
9b168e128a
commit
8c360d7f76
@ -705,6 +705,26 @@ ssize_t cli_read_old(struct cli_state *cli, uint16_t fnum, char *buf,
|
||||
return ret;
|
||||
}
|
||||
|
||||
NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
|
||||
char *buf, off_t offset, size_t size,
|
||||
size_t *nread)
|
||||
{
|
||||
NTSTATUS status;
|
||||
SMB_OFF_T ret;
|
||||
|
||||
status = cli_pull(cli, fnum, offset, size, size,
|
||||
cli_read_sink, &buf, &ret);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (nread) {
|
||||
*nread = ret;
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
write to a file using a SMBwrite and not bypassing 0 byte writes
|
||||
****************************************************************************/
|
||||
|
@ -740,6 +740,9 @@ NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
|
||||
void *priv, SMB_OFF_T *received);
|
||||
ssize_t cli_read_old(struct cli_state *cli, uint16_t fnum, char *buf,
|
||||
off_t offset, size_t size);
|
||||
NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
|
||||
char *buf, off_t offset, size_t size,
|
||||
size_t *nread);
|
||||
NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
|
||||
off_t offset, size_t size1, size_t *ptotal);
|
||||
struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
|
||||
|
Loading…
x
Reference in New Issue
Block a user