r14539: get rid of a pointless union layer in struct smb_notify
authorAndrew Tridgell <tridge@samba.org>
Sat, 18 Mar 2006 09:07:47 +0000 (09:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:58:41 +0000 (13:58 -0500)
(This used to be commit 1e1c5593817e84c59c1a10b5a3c1957e363e5198)

source4/libcli/raw/interfaces.h
source4/libcli/raw/rawnotify.c
source4/ntvfs/cifs/vfs_cifs.c
source4/ntvfs/ntvfs.h
source4/ntvfs/ntvfs_interface.c
source4/smb_server/smb/nttrans.c
source4/torture/gentest.c
source4/torture/raw/notify.c

index d662b9f5ae52ac7fb5612408f584377bcd478fea..88daf304cfa7861150ac97fbc650e79d5a7fce59 100644 (file)
@@ -1746,23 +1746,21 @@ struct smb_nttrans {
 
 
 /* struct for nttrans change notify call */
-union smb_notify {
+struct smb_notify {
        struct {
-               struct {
-                       union smb_handle file;
-                       uint32_t buffer_size;
-                       uint32_t completion_filter;
-                       BOOL recursive;
-               } in;
+               union smb_handle file;
+               uint32_t buffer_size;
+               uint32_t completion_filter;
+               BOOL recursive;
+       } in;
 
-               struct {
-                       uint32_t num_changes;
-                       struct notify_changes {
-                               uint32_t action;
-                               struct smb_wire_string name;
-                       } *changes;
-               } out;
-       } notify;
+       struct {
+               uint32_t num_changes;
+               struct notify_changes {
+                       uint32_t action;
+                       struct smb_wire_string name;
+               } *changes;
+       } out;
 };
 
 enum smb_search_level {RAW_SEARCH_GENERIC                 = 0xF000, 
index c06f0a59f7f9b3f519d40aeaa37878cd6b147f53..8ae5098c012acce07a5d175445277a3653c0f54b 100644 (file)
 /****************************************************************************
 change notify (async send)
 ****************************************************************************/
-struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union smb_notify *parms)
+struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, struct smb_notify *parms)
 {
        struct smb_nttrans nt;
        uint16_t setup[4];
 
        nt.in.max_setup = 0;
-       nt.in.max_param = parms->notify.in.buffer_size;
+       nt.in.max_param = parms->in.buffer_size;
        nt.in.max_data = 0;
        nt.in.setup_count = 4;
        nt.in.setup = setup;
-       SIVAL(setup, 0, parms->notify.in.completion_filter);
-       SSVAL(setup, 4, parms->notify.in.file.fnum);
-       SSVAL(setup, 6, parms->notify.in.recursive);    
+       SIVAL(setup, 0, parms->in.completion_filter);
+       SSVAL(setup, 4, parms->in.file.fnum);
+       SSVAL(setup, 6, parms->in.recursive);   
        nt.in.function = NT_TRANSACT_NOTIFY_CHANGE;
        nt.in.params = data_blob(NULL, 0);
        nt.in.data = data_blob(NULL, 0);
@@ -49,7 +49,7 @@ struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union
 change notify (async recv)
 ****************************************************************************/
 NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req, 
-                                  TALLOC_CTX *mem_ctx, union smb_notify *parms)
+                                  TALLOC_CTX *mem_ctx, struct smb_notify *parms)
 {
        struct smb_nttrans nt;
        NTSTATUS status;
@@ -61,28 +61,28 @@ NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req,
                return status;
        }
 
-       parms->notify.out.changes = NULL;
-       parms->notify.out.num_changes = 0;
+       parms->out.changes = NULL;
+       parms->out.num_changes = 0;
        
        /* count them */
        for (ofs=0; nt.out.params.length - ofs > 12; ) {
                uint32_t next = IVAL(nt.out.params.data, ofs);
-               parms->notify.out.num_changes++;
+               parms->out.num_changes++;
                if (next == 0 ||
                    ofs + next >= nt.out.params.length) break;
                ofs += next;
        }
 
        /* allocate array */
-       parms->notify.out.changes = talloc_array(mem_ctx, struct notify_changes, parms->notify.out.num_changes);
-       if (!parms->notify.out.changes) {
+       parms->out.changes = talloc_array(mem_ctx, struct notify_changes, parms->out.num_changes);
+       if (!parms->out.changes) {
                return NT_STATUS_NO_MEMORY;
        }
 
-       for (i=ofs=0; i<parms->notify.out.num_changes; i++) {
-               parms->notify.out.changes[i].action = IVAL(nt.out.params.data, ofs+4);
+       for (i=ofs=0; i<parms->out.num_changes; i++) {
+               parms->out.changes[i].action = IVAL(nt.out.params.data, ofs+4);
                smbcli_blob_pull_string(session, mem_ctx, &nt.out.params, 
-                                    &parms->notify.out.changes[i].name, 
+                                    &parms->out.changes[i].name, 
                                     ofs+8, ofs+12, STR_UNICODE);
                ofs += IVAL(nt.out.params.data, ofs);
        }
index ee831de665832d9272f2160b16d435e1295d2f2a..50aa58d6fb54ad29d5861c3366c28966523ad3fd 100644 (file)
@@ -891,7 +891,7 @@ static void async_changenotify(struct smbcli_request *c_req)
 /* change notify request - always async */
 static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs, 
                            struct ntvfs_request *req,
-                           union smb_notify *info)
+                           struct smb_notify *info)
 {
        struct cvfs_private *private = ntvfs->private_data;
        struct smbcli_request *c_req;
index 58b95565e984651ffca818df8d6dfe2e7fe71298..09c5b9bdcb619e4b9fe3d44e5447143eabc784d2 100644 (file)
@@ -138,7 +138,7 @@ struct ntvfs_ops {
        /* change notify request */
        NTSTATUS (*notify)(struct ntvfs_module_context *ntvfs,
                           struct ntvfs_request *req,
-                          union smb_notify *info);
+                          struct smb_notify *info);
 
        /* cancel - cancels any pending async request */
        NTSTATUS (*cancel)(struct ntvfs_module_context *ntvfs,
index f17acc9355ed0e33eaa05e7ab1e7ebd57dc9178f..a47c965b2a4242c44d56e292dae6a73493e1a89f 100644 (file)
@@ -314,7 +314,7 @@ _PUBLIC_ NTSTATUS ntvfs_exit(struct ntvfs_request *req)
 /*
   change notify request
 */
-_PUBLIC_ NTSTATUS ntvfs_notify(struct ntvfs_request *req, union smb_notify *info)
+_PUBLIC_ NTSTATUS ntvfs_notify(struct ntvfs_request *req, struct smb_notify *info)
 {
        struct ntvfs_module_context *ntvfs = req->ctx->modules;
        if (!ntvfs->ops->notify) {
@@ -618,7 +618,7 @@ _PUBLIC_ NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs,
 */
 _PUBLIC_ NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
                                    struct ntvfs_request *req,
-                                   union smb_notify *info)
+                                   struct smb_notify *info)
 {
        if (!ntvfs->next || !ntvfs->next->ops->notify) {
                return NT_STATUS_NOT_IMPLEMENTED;
index 78d3405e1d5822a25fc97c7066f2bb715bcaad83..17bccd79b7f1aa29df15418863462fac46790287 100644 (file)
@@ -342,7 +342,7 @@ static NTSTATUS nttrans_ioctl(struct smbsrv_request *req,
  */
 static NTSTATUS nttrans_notify_change_send(struct nttrans_op *op)
 {
-       union smb_notify *info = talloc_get_type(op->op_info, union smb_notify);
+       struct smb_notify *info = talloc_get_type(op->op_info, struct smb_notify);
        size_t size = 0;
        int i;
        NTSTATUS status;
@@ -351,8 +351,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->notify.out.num_changes;i++) {
-               size += 12 + 3 + (1+strlen(info->notify.out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
+       for (i=0;i<info->out.num_changes;i++) {
+               size += 12 + 3 + (1+strlen(info->out.changes[i].name.s)) * MAX_BYTES_PER_CHAR;
        }
 
        status = nttrans_setup_reply(op, op->trans, size, 0, 0);
@@ -361,11 +361,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->notify.out.num_changes;i++) {
+       for (i=0;i<info->out.num_changes;i++) {
                ssize_t len;
 
-               SIVAL(p, 4, info->notify.out.changes[i].action);
-               len = push_string(p + 12, info->notify.out.changes[i].name.s, 
+               SIVAL(p, 4, info->out.changes[i].action);
+               len = push_string(p + 12, info->out.changes[i].name.s, 
                                  op->trans->out.params.length - (ofs+12), STR_UNICODE);
                SIVAL(p, 8, len);
                
@@ -394,20 +394,20 @@ static NTSTATUS nttrans_notify_change(struct smbsrv_request *req,
                                      struct nttrans_op *op)
 {
        struct smb_nttrans *trans = op->trans;
-       union smb_notify *info;
+       struct smb_notify *info;
 
        /* should have at least 4 setup words */
        if (trans->in.setup_count != 4) {
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       info = talloc(op, union smb_notify);
+       info = talloc(op, struct smb_notify);
        NT_STATUS_HAVE_NO_MEMORY(info);
 
-       info->notify.in.completion_filter = IVAL(trans->in.setup, 0);
-       info->notify.in.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;
+       info->in.completion_filter = IVAL(trans->in.setup, 0);
+       info->in.file.fnum         = SVAL(trans->in.setup, 4);
+       info->in.recursive         = SVAL(trans->in.setup, 6);
+       info->in.buffer_size       = trans->in.max_param;
 
        op->op_info = info;
        op->send_fn = nttrans_notify_change_send;
index 6a97f24ba566cc2f3722957662af28efd39b9196..80b09ee6be7be1e61beee2a73fc275d3491ca9ca 100644 (file)
@@ -84,7 +84,7 @@ static struct {
 static struct {
        int notify_count;
        NTSTATUS status;
-       union smb_notify notify;
+       struct smb_notify notify;
 } notifies[NSERVERS][NINSTANCES];
 
 /* info relevant to the current operation */
@@ -680,7 +680,7 @@ static struct ea_struct gen_ea_struct(void)
 */
 static void async_notify(struct smbcli_request *req)
 {
-       union smb_notify notify;
+       struct smb_notify notify;
        NTSTATUS status;
        int i, j;
        uint16_t tid;
@@ -692,9 +692,9 @@ static void async_notify(struct smbcli_request *req)
        if (NT_STATUS_IS_OK(status)) {
                printf("notify tid=%d num_changes=%d action=%d name=%s\n", 
                       tid, 
-                      notify.notify.out.num_changes,
-                      notify.notify.out.changes[0].action,
-                      notify.notify.out.changes[0].name.s);
+                      notify.out.num_changes,
+                      notify.out.changes[0].action,
+                      notify.out.changes[0].name.s);
        }
 
        for (i=0;i<NSERVERS;i++) {
@@ -892,7 +892,7 @@ again:
        for (j=0;j<NINSTANCES;j++) {
                for (i=1;i<NSERVERS;i++) {
                        int n;
-                       union smb_notify not1, not2;
+                       struct smb_notify not1, not2;
 
                        if (notifies[0][j].notify_count != notifies[i][j].notify_count) {
                                if (tries++ < 10) goto again;
@@ -919,26 +919,26 @@ again:
                        not1 = notifies[0][j].notify;
                        not2 = notifies[i][j].notify;
 
-                       for (n=0;n<not1.notify.out.num_changes;n++) {
-                               if (not1.notify.out.changes[n].action != 
-                                   not2.notify.out.changes[n].action) {
+                       for (n=0;n<not1.out.num_changes;n++) {
+                               if (not1.out.changes[n].action != 
+                                   not2.out.changes[n].action) {
                                        printf("Notify action %d inconsistent %d %d\n", n,
-                                              not1.notify.out.changes[n].action,
-                                              not2.notify.out.changes[n].action);
+                                              not1.out.changes[n].action,
+                                              not2.out.changes[n].action);
                                        return False;
                                }
-                               if (strcmp(not1.notify.out.changes[n].name.s,
-                                          not2.notify.out.changes[n].name.s)) {
+                               if (strcmp(not1.out.changes[n].name.s,
+                                          not2.out.changes[n].name.s)) {
                                        printf("Notify name %d inconsistent %s %s\n", n,
-                                              not1.notify.out.changes[n].name.s,
-                                              not2.notify.out.changes[n].name.s);
+                                              not1.out.changes[n].name.s,
+                                              not2.out.changes[n].name.s);
                                        return False;
                                }
-                               if (not1.notify.out.changes[n].name.private_length !=
-                                   not2.notify.out.changes[n].name.private_length) {
+                               if (not1.out.changes[n].name.private_length !=
+                                   not2.out.changes[n].name.private_length) {
                                        printf("Notify name length %d inconsistent %d %d\n", n,
-                                              not1.notify.out.changes[n].name.private_length,
-                                              not2.notify.out.changes[n].name.private_length);
+                                              not1.out.changes[n].name.private_length,
+                                              not2.out.changes[n].name.private_length);
                                        return False;
                                }
                        }
@@ -1820,16 +1820,16 @@ static BOOL handler_sfileinfo(int instance)
 */
 static BOOL handler_notify(int instance)
 {
-       union smb_notify parm[NSERVERS];
+       struct smb_notify parm[NSERVERS];
        int n;
 
-       parm[0].notify.in.buffer_size = gen_io_count();
-       parm[0].notify.in.completion_filter = gen_bits_mask(0xFF);
-       parm[0].notify.in.file.fnum = gen_fnum(instance);
-       parm[0].notify.in.recursive = gen_bool();
+       parm[0].in.buffer_size = gen_io_count();
+       parm[0].in.completion_filter = gen_bits_mask(0xFF);
+       parm[0].in.file.fnum = gen_fnum(instance);
+       parm[0].in.recursive = gen_bool();
 
        GEN_COPY_PARM;
-       GEN_SET_FNUM(notify.in.file.fnum);
+       GEN_SET_FNUM(in.file.fnum);
 
        for (n=0;n<NSERVERS;n++) {
                struct smbcli_request *req;
index 617eddf73f0c8bbc83704763b0f1daf04eb05dbc..38b1fe64b390eba95a2fc130c564f3ec861a5ba0 100644 (file)
@@ -59,7 +59,7 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 {
        BOOL ret = True;
        NTSTATUS status;
-       union smb_notify notify;
+       struct smb_notify notify;
        union smb_open io;
        int i, count, fnum, fnum2;
        struct smbcli_request *req, *req2;
@@ -93,10 +93,10 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        /* ask for a change notify,
           on file or directory name changes */
-       notify.notify.in.buffer_size = 1000;
-       notify.notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
-       notify.notify.in.file.fnum = fnum;
-       notify.notify.in.recursive = True;
+       notify.in.buffer_size = 1000;
+       notify.in.completion_filter = FILE_NOTIFY_CHANGE_NAME;
+       notify.in.file.fnum = fnum;
+       notify.in.recursive = True;
 
        printf("testing notify cancel\n");
 
@@ -113,9 +113,9 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       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);
+       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);
 
        printf("testing notify rmdir\n");
 
@@ -124,9 +124,9 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
-       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);
+       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);
 
        printf("testing notify mkdir - rmdir - mkdir - rmdir\n");
 
@@ -137,15 +137,15 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        req = smb_raw_changenotify_send(cli->tree, &notify);
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
-       CHECK_VAL(notify.notify.out.num_changes, 4);
-       CHECK_VAL(notify.notify.out.changes[0].action, NOTIFY_ACTION_ADDED);
-       CHECK_WSTR(notify.notify.out.changes[0].name, "subdir-name", STR_UNICODE);
-       CHECK_VAL(notify.notify.out.changes[1].action, NOTIFY_ACTION_REMOVED);
-       CHECK_WSTR(notify.notify.out.changes[1].name, "subdir-name", STR_UNICODE);
-       CHECK_VAL(notify.notify.out.changes[2].action, NOTIFY_ACTION_ADDED);
-       CHECK_WSTR(notify.notify.out.changes[2].name, "subdir-name", STR_UNICODE);
-       CHECK_VAL(notify.notify.out.changes[3].action, NOTIFY_ACTION_REMOVED);
-       CHECK_WSTR(notify.notify.out.changes[3].name, "subdir-name", STR_UNICODE);
+       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);
 
        count = torture_numops;
        printf("testing buffered notify on create of %d files\n", count);
@@ -164,12 +164,12 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        /* (1st notify) setup a new notify on a different directory handle.
           This new notify won't see the events above. */
-       notify.notify.in.file.fnum = fnum2;
+       notify.in.file.fnum = fnum2;
        req2 = smb_raw_changenotify_send(cli->tree, &notify);
 
        /* (2nd notify) whereas this notify will see the above buffered events,
           and it directly returns the buffered events */
-       notify.notify.in.file.fnum = fnum;
+       notify.in.file.fnum = fnum;
        req = smb_raw_changenotify_send(cli->tree, &notify);
 
        /* (1st unlink) as the 2nd notify directly returns,
@@ -183,18 +183,18 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
 
-       CHECK_VAL(notify.notify.out.num_changes, count);
-       for (i=1;i<notify.notify.out.num_changes;i++) {
-               CHECK_VAL(notify.notify.out.changes[i].action, NOTIFY_ACTION_ADDED);
+       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_WSTR(notify.notify.out.changes[0].name, "test0.txt", STR_UNICODE);
+       CHECK_WSTR(notify.out.changes[0].name, "test0.txt", STR_UNICODE);
 
        /* and now from the 1st notify */
        status = smb_raw_changenotify_recv(req2, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
-       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);
+       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);
 
        /* (3rd notify) this notify will only see the 1st unlink */
        req = smb_raw_changenotify_send(cli->tree, &notify);
@@ -207,26 +207,26 @@ static BOOL test_notify_dir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        /* recev the 3rd notify */
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
-       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);
+       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);
 
        /* and we now see the rest of the unlink calls on both directory handles */
-       notify.notify.in.file.fnum = fnum;
+       notify.in.file.fnum = fnum;
        req = smb_raw_changenotify_send(cli->tree, &notify);
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
-       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);
+       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);
        }
-       notify.notify.in.file.fnum = fnum2;
+       notify.in.file.fnum = fnum2;
        req = smb_raw_changenotify_send(cli->tree, &notify);
        status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
        CHECK_STATUS(status, NT_STATUS_OK);
-       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);
+       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);
        }
 
 done:
@@ -243,7 +243,7 @@ static BOOL test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        BOOL ret = True;
        union smb_open io;
        union smb_close cl;
-       union smb_notify notify;
+       struct smb_notify notify;
        struct smbcli_request *req;
        int fnum;
        const char *fname = BASEDIR "\\file.txt";
@@ -268,10 +268,10 @@ static BOOL test_notify_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 
        /* ask for a change notify,
           on file or directory name changes */
-       notify.notify.in.file.fnum = fnum;
-       notify.notify.in.buffer_size = 1000;
-       notify.notify.in.completion_filter = FILE_NOTIFY_CHANGE_STREAM_NAME;
-       notify.notify.in.recursive = False;
+       notify.in.file.fnum = fnum;
+       notify.in.buffer_size = 1000;
+       notify.in.completion_filter = FILE_NOTIFY_CHANGE_STREAM_NAME;
+       notify.in.recursive = False;
 
        printf("testing if notifies on file handles are invalid (should be)\n");