1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-26 23:33:15 +03:00

r14173: change smb interface structures to always use

a union smb_file, to abtract
- const char *path fot qpathinfo and setpathinfo
- uint16_t fnum for SMB
- smb2_handle handle for SMB2

the idea is to later add a struct ntvfs_handle *ntvfs
so that the ntvfs subsystem don't need to know the difference between SMB and SMB2

metze
This commit is contained in:
Stefan Metzmacher
2006-03-10 20:49:20 +00:00
committed by Gerald (Jerry) Carter
parent fba4229e56
commit 2ef3f59709
72 changed files with 970 additions and 941 deletions

View File

@@ -77,7 +77,7 @@ static NTSTATUS nttrans_create_send(struct nttrans_op *op)
NT_STATUS_HAVE_NO_MEMORY(params);
SSVAL(params, 0, io->ntcreatex.out.oplock_level);
SSVAL(params, 2, io->ntcreatex.out.fnum);
SSVAL(params, 2, io->ntcreatex.file.fnum);
SIVAL(params, 4, io->ntcreatex.out.create_action);
SIVAL(params, 8, 0); /* ea error offset */
push_nttime(params, 12, io->ntcreatex.out.create_time);
@@ -234,8 +234,8 @@ static NTSTATUS nttrans_query_sec_desc(struct smbsrv_request *req,
NT_STATUS_HAVE_NO_MEMORY(io);
io->query_secdesc.level = RAW_FILEINFO_SEC_DESC;
io->query_secdesc.in.fnum = SVAL(trans->in.params.data, 0);
io->query_secdesc.secinfo_flags = IVAL(trans->in.params.data, 4);
io->query_secdesc.file.fnum = SVAL(trans->in.params.data, 0);
io->query_secdesc.in.secinfo_flags = IVAL(trans->in.params.data, 4);
op->op_info = io;
op->send_fn = nttrans_query_sec_desc_send;
@@ -322,7 +322,7 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req,
blob = &trans->in.data;
nt->ntioctl.level = RAW_IOCTL_NTIOCTL;
nt->ntioctl.in.fnum = fnum;
nt->ntioctl.file.fnum = fnum;
nt->ntioctl.in.function = function;
nt->ntioctl.in.fsctl = fsctl;
nt->ntioctl.in.filter = filter;
@@ -341,7 +341,7 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req,
*/
static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
{
struct smb_notify *info = talloc_get_type(op->op_info, struct smb_notify);
union smb_notify *info = talloc_get_type(op->op_info, union smb_notify);
size_t size = 0;
int i;
NTSTATUS status;
@@ -350,8 +350,8 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
#define MAX_BYTES_PER_CHAR 3
/* work out how big the reply buffer could be */
for (i=0;i<info->out.num_changes;i++) {
size += 12 + 3 + (1+strlen(info->out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
for (i=0;i<info->notify.out.num_changes;i++) {
size += 12 + 3 + (1+strlen(info->notify.out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
}
status = nttrans_setup_reply(op, op->trans, size, 0, 0);
@@ -360,11 +360,11 @@ static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
p = op->trans->out.params.data;
/* construct the changes buffer */
for (i=0;i<info->out.num_changes;i++) {
for (i=0;i<info->notify.out.num_changes;i++) {
ssize_t len;
SIVAL(p, 4, info->out.changes[i].action);
len = push_string(p + 12, info->out.changes[i].name.s,
SIVAL(p, 4, info->notify.out.changes[i].action);
len = push_string(p + 12, info->notify.out.changes[i].name.s,
op->trans->out.params.length - (ofs+12), STR_UNICODE);
SIVAL(p, 8, len);
@@ -393,20 +393,20 @@ static NTSTATUS nttrans_notify_change(struct smbsrv_request *req,
struct nttrans_op *op)
{
struct smb_nttrans *trans = op->trans;
struct smb_notify *info;
union smb_notify *info;
/* should have at least 4 setup words */
if (trans->in.setup_count != 4) {
return NT_STATUS_INVALID_PARAMETER;
}
info = talloc(op, struct smb_notify);
info = talloc(op, union smb_notify);
NT_STATUS_HAVE_NO_MEMORY(info);
info->in.completion_filter = IVAL(trans->in.setup, 0);
info->in.fnum = SVAL(trans->in.setup, 4);
info->in.recursive = SVAL(trans->in.setup, 6);
info->in.buffer_size = trans->in.max_param;
info->notify.in.completion_filter = IVAL(trans->in.setup, 0);
info->notify.file.fnum = SVAL(trans->in.setup, 4);
info->notify.in.recursive = SVAL(trans->in.setup, 6);
info->notify.in.buffer_size = trans->in.max_param;
op->op_info = info;
op->send_fn = nttrans_notify_change_send;