diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-03-10 20:49:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:56:57 -0500 |
commit | 307e43bb5628e8b53a930c2928279af994281ba5 (patch) | |
tree | 68fa41cf4e697ae94b23cedab5eb7013932fc88d /source4/torture/raw/notify.c | |
parent | 2b3767b1fe7744f0412531e1522e1d5af5dc39c6 (diff) | |
download | samba-307e43bb5628e8b53a930c2928279af994281ba5.tar.gz samba-307e43bb5628e8b53a930c2928279af994281ba5.tar.bz2 samba-307e43bb5628e8b53a930c2928279af994281ba5.zip |
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 used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f)
Diffstat (limited to 'source4/torture/raw/notify.c')
-rw-r--r-- | source4/torture/raw/notify.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c index 7e96beb646..766c5374a9 100644 --- a/source4/torture/raw/notify.c +++ b/source4/torture/raw/notify.c @@ -60,7 +60,7 @@ BOOL torture_raw_notify(void) BOOL ret = True; TALLOC_CTX *mem_ctx; NTSTATUS status; - struct smb_notify notify; + union smb_notify notify; union smb_open io; int i, count, fnum, fnum2; struct smbcli_request *req, *req2; @@ -94,17 +94,17 @@ BOOL torture_raw_notify(void) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - fnum = io.ntcreatex.out.fnum; + fnum = io.ntcreatex.file.fnum; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - fnum2 = io.ntcreatex.out.fnum; + fnum2 = io.ntcreatex.file.fnum; /* ask for a change notify */ - notify.in.buffer_size = 1000; - notify.in.completion_filter = 0x3; - notify.in.fnum = fnum; - notify.in.recursive = True; + notify.notify.in.buffer_size = 1000; + notify.notify.in.completion_filter = 0x3; + notify.notify.file.fnum = fnum; + notify.notify.in.recursive = True; printf("testing notify mkdir\n"); @@ -114,9 +114,9 @@ BOOL torture_raw_notify(void) status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, 1); - CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_ADDED); - CHECK_WSTR(notify.out.changes[0].name, "subdir-name", STR_UNICODE); + CHECK_VAL(notify.notify.out.num_changes, 1); + CHECK_VAL(notify.notify.out.changes[0].action, NOTIFY_ACTION_ADDED); + CHECK_WSTR(notify.notify.out.changes[0].name, "subdir-name", STR_UNICODE); printf("testing notify rmdir\n"); @@ -125,9 +125,9 @@ BOOL torture_raw_notify(void) status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, 1); - CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_REMOVED); - CHECK_WSTR(notify.out.changes[0].name, "subdir-name", STR_UNICODE); + CHECK_VAL(notify.notify.out.num_changes, 1); + CHECK_VAL(notify.notify.out.changes[0].action, NOTIFY_ACTION_REMOVED); + CHECK_WSTR(notify.notify.out.changes[0].name, "subdir-name", STR_UNICODE); printf("testing notify cancel\n"); @@ -154,12 +154,12 @@ BOOL torture_raw_notify(void) /* setup a new notify on a different directory handle. This new notify won't see the events above. */ - notify.in.fnum = fnum2; + notify.notify.file.fnum = fnum2; req2 = smb_raw_changenotify_send(cli->tree, ¬ify); /* whereas this notify will see the above buffered events as well */ - notify.in.fnum = fnum; + notify.notify.file.fnum = fnum; req = smb_raw_changenotify_send(cli->tree, ¬ify); status = smbcli_unlink(cli->tree, BASEDIR "\\test0.txt"); @@ -169,16 +169,16 @@ BOOL torture_raw_notify(void) status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, count+1); - for (i=0;i<notify.out.num_changes;i++) { - CHECK_VAL(notify.out.changes[i].action, NOTIFY_ACTION_ADDED); + CHECK_VAL(notify.notify.out.num_changes, count+1); + for (i=0;i<notify.notify.out.num_changes;i++) { + CHECK_VAL(notify.notify.out.changes[i].action, NOTIFY_ACTION_ADDED); } - CHECK_WSTR(notify.out.changes[0].name, "subdir-name", STR_UNICODE); + CHECK_WSTR(notify.notify.out.changes[0].name, "subdir-name", STR_UNICODE); /* and now from the 1st notify */ status = smb_raw_changenotify_recv(req2, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, 1); + CHECK_VAL(notify.notify.out.num_changes, 1); printf("testing notify on wildcard unlink for %d files\n", count); @@ -189,26 +189,26 @@ BOOL torture_raw_notify(void) status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, 1); - CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_REMOVED); - CHECK_WSTR(notify.out.changes[0].name, "test0.txt", STR_UNICODE); + CHECK_VAL(notify.notify.out.num_changes, 1); + CHECK_VAL(notify.notify.out.changes[0].action, NOTIFY_ACTION_REMOVED); + CHECK_WSTR(notify.notify.out.changes[0].name, "test0.txt", STR_UNICODE); /* and we now see the rest of the unlink calls */ req = smb_raw_changenotify_send(cli->tree, ¬ify); status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, count-1); - for (i=0;i<notify.out.num_changes;i++) { - CHECK_VAL(notify.out.changes[i].action, NOTIFY_ACTION_REMOVED); + CHECK_VAL(notify.notify.out.num_changes, count-1); + for (i=0;i<notify.notify.out.num_changes;i++) { + CHECK_VAL(notify.notify.out.changes[i].action, NOTIFY_ACTION_REMOVED); } - notify.in.fnum = fnum2; + notify.notify.file.fnum = fnum2; req = smb_raw_changenotify_send(cli->tree, ¬ify); status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VAL(notify.out.num_changes, count-1); - for (i=0;i<notify.out.num_changes;i++) { - CHECK_VAL(notify.out.changes[i].action, NOTIFY_ACTION_REMOVED); + CHECK_VAL(notify.notify.out.num_changes, count-1); + for (i=0;i<notify.notify.out.num_changes;i++) { + CHECK_VAL(notify.notify.out.changes[i].action, NOTIFY_ACTION_REMOVED); } done: |