2 * Server-side device management
4 * Copyright (C) 1999 Alexandre Julliard
9 * all this stuff is a simple hack to avoid breaking
10 * client-side device support.
21 #include "server/thread.h"
25 struct object obj; /* object header */
26 int id; /* client identifier */
29 static void device_dump( struct object *obj, int verbose );
30 static int device_get_info( struct object *obj, struct get_file_info_reply *reply );
31 static void device_destroy( struct object *obj );
33 static const struct object_ops device_ops =
37 NULL, /* should never get called */
38 NULL, /* should never get called */
39 NULL, /* should never get called */
47 struct object *create_device( int id )
51 if (!(dev = mem_alloc(sizeof(*dev)))) return NULL;
52 init_object( &dev->obj, &device_ops, NULL );
57 static void device_dump( struct object *obj, int verbose )
59 struct device *dev = (struct device *)obj;
60 assert( obj->ops == &device_ops );
61 fprintf( stderr, "Device id=%08x\n", dev->id );
64 static int device_get_info( struct object *obj, struct get_file_info_reply *reply )
66 struct device *dev = (struct device *)obj;
67 assert( obj->ops == &device_ops );
68 memset( reply, 0, sizeof(*reply) );
69 reply->type = FILE_TYPE_UNKNOWN;
70 reply->attr = dev->id; /* hack! */
74 static void device_destroy( struct object *obj )
76 struct device *dev = (struct device *)obj;
77 assert( obj->ops == &device_ops );