{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
union smb_close cl;
int i, count, fnum, fnum2;
/* ask for a change notify,
on file or directory name changes */
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
- notify.in.file.fnum = fnum;
- notify.in.recursive = True;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+ notify.nttrans.in.file.fnum = fnum;
+ notify.nttrans.in.recursive = True;
printf("testing notify cancel\n");
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.nttrans.out.num_changes, 1);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name", STR_UNICODE);
printf("testing notify rmdir\n");
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.nttrans.out.num_changes, 1);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name", STR_UNICODE);
printf("testing notify mkdir - rmdir - mkdir - rmdir\n");
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, 4);
- CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[0].name, "subdir-name", STR_UNICODE);
- CHECK_VAL(notify.out.changes[1].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[1].name, "subdir-name", STR_UNICODE);
- CHECK_VAL(notify.out.changes[2].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[2].name, "subdir-name", STR_UNICODE);
- CHECK_VAL(notify.out.changes[3].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[3].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.num_changes, 4);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[1].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[1].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[2].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[2].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[3].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[3].name, "subdir-name", STR_UNICODE);
count = torture_numops;
printf("testing buffered notify on create of %d files\n", count);
/* (1st notify) setup a new notify on a different directory handle.
This new notify won't see the events above. */
- notify.in.file.fnum = fnum2;
+ notify.nttrans.in.file.fnum = fnum2;
req2 = smb_raw_changenotify_send(cli->tree, ¬ify);
/* (2nd notify) whereas this notify will see the above buffered events,
and it directly returns the buffered events */
- notify.in.file.fnum = fnum;
+ notify.nttrans.in.file.fnum = fnum;
req = smb_raw_changenotify_send(cli->tree, ¬ify);
/* (1st unlink) as the 2nd notify directly returns,
status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(notify.out.num_changes, count);
- for (i=1;i<notify.out.num_changes;i++) {
- CHECK_VAL(notify.out.changes[i].action, NOTIFY_ACTION_ADDED);
+ CHECK_VAL(notify.nttrans.out.num_changes, count);
+ for (i=1;i<notify.nttrans.out.num_changes;i++) {
+ CHECK_VAL(notify.nttrans.out.changes[i].action, NOTIFY_ACTION_ADDED);
}
- CHECK_WSTR(notify.out.changes[0].name, "test0.txt", STR_UNICODE);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "test0.txt", 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.out.changes[0].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[0].name, "test0.txt", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.num_changes, 1);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "test0.txt", STR_UNICODE);
/* (3rd notify) this notify will only see the 1st unlink */
req = smb_raw_changenotify_send(cli->tree, ¬ify);
/* receive the 3rd notify */
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.nttrans.out.num_changes, 1);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "test0.txt", STR_UNICODE);
/* and we now see the rest of the unlink calls on both directory handles */
- notify.in.file.fnum = fnum;
+ notify.nttrans.in.file.fnum = fnum;
sleep(1);
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.nttrans.out.num_changes, count-1);
+ for (i=0;i<notify.nttrans.out.num_changes;i++) {
+ CHECK_VAL(notify.nttrans.out.changes[i].action, NOTIFY_ACTION_REMOVED);
}
- notify.in.file.fnum = fnum2;
+ notify.nttrans.in.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.nttrans.out.num_changes, count-1);
+ for (i=0;i<notify.nttrans.out.num_changes;i++) {
+ CHECK_VAL(notify.nttrans.out.changes[i].action, NOTIFY_ACTION_REMOVED);
}
printf("testing if a close() on the dir handle triggers the notify reply\n");
- notify.in.file.fnum = fnum;
+ notify.nttrans.in.file.fnum = fnum;
req = smb_raw_changenotify_send(cli->tree, ¬ify);
cl.close.level = RAW_CLOSE_CLOSE;
status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(notify.out.num_changes, 0);
+ CHECK_VAL(notify.nttrans.out.num_changes, 0);
done:
smb_raw_exit(cli->session);
{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
int fnum;
struct smbcli_request *req1, *req2;
/* ask for a change notify, on file or directory name
changes. Setup both with and without recursion */
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_CREATION;
- notify.in.file.fnum = fnum;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_CREATION;
+ notify.nttrans.in.file.fnum = fnum;
- notify.in.recursive = True;
+ notify.nttrans.in.recursive = True;
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
- notify.in.recursive = False;
+ notify.nttrans.in.recursive = False;
req2 = smb_raw_changenotify_send(cli->tree, ¬ify);
/* cancel initial requests so the buffer is setup */
smbcli_rename(cli->tree, BASEDIR "\\subdir-name\\subname2", BASEDIR "\\subname2-r");
smbcli_rename(cli->tree, BASEDIR "\\subname2-r", BASEDIR "\\subname3-r");
- notify.in.completion_filter = 0;
- notify.in.recursive = True;
+ notify.nttrans.in.completion_filter = 0;
+ notify.nttrans.in.recursive = True;
msleep(10);
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name");
smbcli_unlink(cli->tree, BASEDIR "\\subname3-r");
- notify.in.recursive = False;
+ notify.nttrans.in.recursive = False;
req2 = smb_raw_changenotify_send(cli->tree, ¬ify);
status = smb_raw_changenotify_recv(req1, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(notify.out.num_changes, 11);
- CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[0].name, "subdir-name", STR_UNICODE);
- CHECK_VAL(notify.out.changes[1].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[1].name, "subdir-name\\subname1", STR_UNICODE);
- CHECK_VAL(notify.out.changes[2].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[2].name, "subdir-name\\subname2", STR_UNICODE);
- CHECK_VAL(notify.out.changes[3].action, NOTIFY_ACTION_OLD_NAME);
- CHECK_WSTR(notify.out.changes[3].name, "subdir-name\\subname1", STR_UNICODE);
- CHECK_VAL(notify.out.changes[4].action, NOTIFY_ACTION_NEW_NAME);
- CHECK_WSTR(notify.out.changes[4].name, "subdir-name\\subname1-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.num_changes, 11);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[1].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[1].name, "subdir-name\\subname1", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[2].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[2].name, "subdir-name\\subname2", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[3].action, NOTIFY_ACTION_OLD_NAME);
+ CHECK_WSTR(notify.nttrans.out.changes[3].name, "subdir-name\\subname1", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[4].action, NOTIFY_ACTION_NEW_NAME);
+ CHECK_WSTR(notify.nttrans.out.changes[4].name, "subdir-name\\subname1-r", STR_UNICODE);
/* the remove/add between directories is acceptable in either order */
- if (notify.out.changes[5].action == NOTIFY_ACTION_ADDED) {
- CHECK_VAL(notify.out.changes[6].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[6].name, "subdir-name\\subname2", STR_UNICODE);
- CHECK_VAL(notify.out.changes[5].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[5].name, "subname2-r", STR_UNICODE);
+ if (notify.nttrans.out.changes[5].action == NOTIFY_ACTION_ADDED) {
+ CHECK_VAL(notify.nttrans.out.changes[6].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[6].name, "subdir-name\\subname2", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[5].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[5].name, "subname2-r", STR_UNICODE);
} else {
- CHECK_VAL(notify.out.changes[5].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[5].name, "subdir-name\\subname2", STR_UNICODE);
- CHECK_VAL(notify.out.changes[6].action, NOTIFY_ACTION_ADDED);
- CHECK_WSTR(notify.out.changes[6].name, "subname2-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[5].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[5].name, "subdir-name\\subname2", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[6].action, NOTIFY_ACTION_ADDED);
+ CHECK_WSTR(notify.nttrans.out.changes[6].name, "subname2-r", STR_UNICODE);
}
- CHECK_VAL(notify.out.changes[7].action, NOTIFY_ACTION_MODIFIED);
- CHECK_WSTR(notify.out.changes[7].name, "subname2-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[7].action, NOTIFY_ACTION_MODIFIED);
+ CHECK_WSTR(notify.nttrans.out.changes[7].name, "subname2-r", STR_UNICODE);
- CHECK_VAL(notify.out.changes[8].action, NOTIFY_ACTION_OLD_NAME);
- CHECK_WSTR(notify.out.changes[8].name, "subname2-r", STR_UNICODE);
- CHECK_VAL(notify.out.changes[9].action, NOTIFY_ACTION_NEW_NAME);
- CHECK_WSTR(notify.out.changes[9].name, "subname3-r", STR_UNICODE);
- CHECK_VAL(notify.out.changes[10].action, NOTIFY_ACTION_MODIFIED);
- CHECK_WSTR(notify.out.changes[10].name, "subname3-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[8].action, NOTIFY_ACTION_OLD_NAME);
+ CHECK_WSTR(notify.nttrans.out.changes[8].name, "subname2-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[9].action, NOTIFY_ACTION_NEW_NAME);
+ CHECK_WSTR(notify.nttrans.out.changes[9].name, "subname3-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[10].action, NOTIFY_ACTION_MODIFIED);
+ CHECK_WSTR(notify.nttrans.out.changes[10].name, "subname3-r", STR_UNICODE);
status = smb_raw_changenotify_recv(req2, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(notify.out.num_changes, 3);
- CHECK_VAL(notify.out.changes[0].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[0].name, "subdir-name\\subname1-r", STR_UNICODE);
- CHECK_VAL(notify.out.changes[1].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[1].name, "subdir-name", STR_UNICODE);
- CHECK_VAL(notify.out.changes[2].action, NOTIFY_ACTION_REMOVED);
- CHECK_WSTR(notify.out.changes[2].name, "subname3-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.num_changes, 3);
+ CHECK_VAL(notify.nttrans.out.changes[0].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name\\subname1-r", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[1].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[1].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.changes[2].action, NOTIFY_ACTION_REMOVED);
+ CHECK_WSTR(notify.nttrans.out.changes[2].name, "subname3-r", STR_UNICODE);
done:
smb_raw_exit(cli->session);
{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
int fnum, fnum2;
uint32_t mask;
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = BASEDIR;
- notify.in.buffer_size = 1000;
- notify.in.recursive = True;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.recursive = True;
#define NOTIFY_MASK_TEST(setup, op, cleanup, Action, expected, nchanges) \
do { for (mask=i=0;i<32;i++) { \
CHECK_STATUS(status, NT_STATUS_OK); \
fnum = io.ntcreatex.out.file.fnum; \
setup \
- notify.in.file.fnum = fnum; \
- notify.in.completion_filter = (1<<i); \
+ notify.nttrans.in.file.fnum = fnum; \
+ notify.nttrans.in.completion_filter = (1<<i); \
req = smb_raw_changenotify_send(cli->tree, ¬ify); \
op \
msleep(10); smb_raw_ntcancel(req); \
if (NT_STATUS_EQUAL(status, NT_STATUS_CANCELLED)) continue; \
CHECK_STATUS(status, NT_STATUS_OK); \
/* special case to cope with file rename behaviour */ \
- if (nchanges == 2 && notify.out.num_changes == 1 && \
- notify.out.changes[0].action == NOTIFY_ACTION_MODIFIED && \
+ if (nchanges == 2 && notify.nttrans.out.num_changes == 1 && \
+ notify.nttrans.out.changes[0].action == NOTIFY_ACTION_MODIFIED && \
((expected) & FILE_NOTIFY_CHANGE_ATTRIBUTES) && \
Action == NOTIFY_ACTION_OLD_NAME) { \
printf("(rename file special handling OK)\n"); \
- } else if (nchanges != notify.out.num_changes || \
- notify.out.changes[0].action != Action || \
- strcmp(notify.out.changes[0].name.s, "tname1") != 0) { \
+ } else if (nchanges != notify.nttrans.out.num_changes || \
+ notify.nttrans.out.changes[0].action != Action || \
+ strcmp(notify.nttrans.out.changes[0].name.s, "tname1") != 0) { \
printf("ERROR: nchanges=%d action=%d filter=0x%08x\n", \
- notify.out.num_changes, \
- notify.out.changes[0].action, \
- notify.in.completion_filter); \
+ notify.nttrans.out.num_changes, \
+ notify.nttrans.out.changes[0].action, \
+ notify.nttrans.in.completion_filter); \
ret = False; \
} \
mask |= (1<<i); \
BOOL ret = True;
union smb_open io;
union smb_close cl;
- struct smb_notify notify;
+ union smb_notify notify;
struct smbcli_request *req;
int fnum;
const char *fname = BASEDIR "\\file.txt";
/* ask for a change notify,
on file or directory name changes */
- notify.in.file.fnum = fnum;
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_STREAM_NAME;
- notify.in.recursive = False;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.file.fnum = fnum;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_STREAM_NAME;
+ notify.nttrans.in.recursive = False;
printf("testing if notifies on file handles are invalid (should be)\n");
{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
int fnum;
struct smbcli_request *req;
/* ask for a change notify,
on file or directory name changes */
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
- notify.in.file.fnum = fnum;
- notify.in.recursive = True;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+ notify.nttrans.in.file.fnum = fnum;
+ notify.nttrans.in.recursive = True;
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, 0);
+ CHECK_VAL(notify.nttrans.out.num_changes, 0);
done:
torture_close_connection(cli);
{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
int fnum;
struct smbcli_request *req;
/* ask for a change notify,
on file or directory name changes */
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
- notify.in.file.fnum = fnum;
- notify.in.recursive = True;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+ notify.nttrans.in.file.fnum = fnum;
+ notify.nttrans.in.recursive = True;
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, 0);
+ CHECK_VAL(notify.nttrans.out.num_changes, 0);
done:
torture_close_connection(cli);
{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
int fnum;
struct smbcli_request *req;
/* ask for a change notify,
on file or directory name changes */
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
- notify.in.file.fnum = fnum;
- notify.in.recursive = True;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+ notify.nttrans.in.file.fnum = fnum;
+ notify.nttrans.in.recursive = True;
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, 0);
+ CHECK_VAL(notify.nttrans.out.num_changes, 0);
done:
torture_close_connection(cli);
{
BOOL ret = True;
NTSTATUS status;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
int fnum;
struct smbcli_request *req1, *req2;
/* ask for a change notify,
on file or directory name changes */
- notify.in.buffer_size = 1000;
- notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
- notify.in.file.fnum = fnum;
- notify.in.recursive = True;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 1000;
+ notify.nttrans.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+ notify.nttrans.in.file.fnum = fnum;
+ notify.nttrans.in.recursive = True;
req1 = smb_raw_changenotify_send(cli->tree, ¬ify);
req2 = smb_raw_changenotify_send(cli->tree, ¬ify);
status = smb_raw_changenotify_recv(req1, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(notify.out.num_changes, 1);
- CHECK_WSTR(notify.out.changes[0].name, "subdir-name", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.num_changes, 1);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name", STR_UNICODE);
smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name2");
status = smb_raw_changenotify_recv(req2, mem_ctx, ¬ify);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(notify.out.num_changes, 1);
- CHECK_WSTR(notify.out.changes[0].name, "subdir-name2", STR_UNICODE);
+ CHECK_VAL(notify.nttrans.out.num_changes, 1);
+ CHECK_WSTR(notify.nttrans.out.changes[0].name, "subdir-name2", STR_UNICODE);
done:
smb_raw_exit(cli->session);
static BOOL test_notify_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
BOOL ret = True;
- struct smb_notify notify;
+ union smb_notify notify;
union smb_open io;
struct smbcli_request *req;
struct {
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
- notify.in.buffer_size = 20000;
+ notify.nttrans.level = RAW_NOTIFY_NTTRANS;
+ notify.nttrans.in.buffer_size = 20000;
/*
setup the directory tree, and the notify buffer on each directory
CHECK_STATUS(status, NT_STATUS_OK);
dirs[i].fnum = io.ntcreatex.out.file.fnum;
- notify.in.completion_filter = dirs[i].filter;
- notify.in.file.fnum = dirs[i].fnum;
- notify.in.recursive = dirs[i].recursive;
+ notify.nttrans.in.completion_filter = dirs[i].filter;
+ notify.nttrans.in.file.fnum = dirs[i].fnum;
+ notify.nttrans.in.recursive = dirs[i].recursive;
req = smb_raw_changenotify_send(cli->tree, ¬ify);
smb_raw_ntcancel(req);
status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify);
/* count events that have happened in each dir */
for (i=0;i<ARRAY_SIZE(dirs);i++) {
- notify.in.file.fnum = dirs[i].fnum;
+ notify.nttrans.in.file.fnum = dirs[i].fnum;
req = smb_raw_changenotify_send(cli->tree, ¬ify);
smb_raw_ntcancel(req);
- notify.out.num_changes = 0;
+ notify.nttrans.out.num_changes = 0;
status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify);
- if (notify.out.num_changes != dirs[i].expected) {
+ if (notify.nttrans.out.num_changes != dirs[i].expected) {
printf("ERROR: i=%d expected %d got %d for '%s'\n",
- i, dirs[i].expected, notify.out.num_changes,
+ i, dirs[i].expected, notify.nttrans.out.num_changes,
dirs[i].path);
ret = False;
}