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
);
27 static const struct object_ops change_ops
=
29 sizeof(struct change
), /* size */
30 change_dump
, /* dump */
31 add_queue
, /* add_queue */
32 remove_queue
, /* remove_queue */
33 change_signaled
, /* signaled */
34 no_satisfied
, /* satisfied */
35 NULL
, /* get_poll_events */
36 NULL
, /* poll_event */
37 no_read_fd
, /* get_read_fd */
38 no_write_fd
, /* get_write_fd */
40 no_get_file_info
, /* get_file_info */
41 no_destroy
/* destroy */
45 static struct change
*create_change_notification( int subtree
, int filter
)
47 struct change
*change
;
48 if ((change
= alloc_object( &change_ops
, -1 )))
50 change
->subtree
= subtree
;
51 change
->filter
= filter
;
56 static void change_dump( struct object
*obj
, int verbose
)
58 struct change
*change
= (struct change
*)obj
;
59 assert( obj
->ops
== &change_ops
);
60 fprintf( stderr
, "Change notification sub=%d filter=%08x\n",
61 change
->subtree
, change
->filter
);
64 static int change_signaled( struct object
*obj
, struct thread
*thread
)
66 /* struct change *change = (struct change *)obj;*/
67 assert( obj
->ops
== &change_ops
);
68 return 0; /* never signaled for now */
71 /* create a change notification */
72 DECL_HANDLER(create_change_notification
)
74 struct change
*change
;
77 if ((change
= create_change_notification( req
->subtree
, req
->filter
)))
79 req
->handle
= alloc_handle( current
->process
, change
,
80 STANDARD_RIGHTS_REQUIRED
|SYNCHRONIZE
, 0 );
81 release_object( change
);