2 * Server-side change notification management
4 * Copyright (C) 1998 Alexandre Julliard
19 struct object obj; /* object header */
20 int subtree; /* watch all the subtree */
21 int filter; /* notification filter */
24 static void change_dump( struct object *obj, int verbose );
25 static int change_signaled( struct object *obj, struct thread *thread );
26 static void change_destroy( struct object *obj );
28 static const struct object_ops change_ops =
43 static struct object *create_change_notification( int subtree, int filter )
45 struct change *change;
46 if (!(change = mem_alloc( sizeof(*change) ))) return NULL;
47 init_object( &change->obj, &change_ops, NULL );
48 change->subtree = subtree;
49 change->filter = filter;
53 static void change_dump( struct object *obj, int verbose )
55 struct change *change = (struct change *)obj;
56 assert( obj->ops == &change_ops );
57 fprintf( stderr, "Change notification sub=%d filter=%08x\n",
58 change->subtree, change->filter );
61 static int change_signaled( struct object *obj, struct thread *thread )
63 /* struct change *change = (struct change *)obj;*/
64 assert( obj->ops == &change_ops );
65 return 0; /* never signaled for now */
68 static void change_destroy( struct object *obj )
70 struct change *change = (struct change *)obj;
71 assert( obj->ops == &change_ops );
75 /* create a change notification */
76 DECL_HANDLER(create_change_notification)
79 struct create_change_notification_reply reply = { -1 };
81 if ((obj = create_change_notification( req->subtree, req->filter )))
83 reply.handle = alloc_handle( current->process, obj,
84 STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE, 0 );
85 release_object( obj );
87 send_reply( current, -1, 1, &reply, sizeof(reply) );