Alexandre Julliard | 43c190e | 1999-05-15 10:48:19 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Server-side handle definitions |
| 3 | * |
| 4 | * Copyright (C) 1999 Alexandre Julliard |
| 5 | */ |
| 6 | |
| 7 | #ifndef __WINE_SERVER_HANDLE_H |
| 8 | #define __WINE_SERVER_HANDLE_H |
| 9 | |
| 10 | #ifndef __WINE_SERVER__ |
| 11 | #error This file can only be used in the Wine server |
| 12 | #endif |
| 13 | |
Alexandre Julliard | 5bc7808 | 1999-06-22 17:26:53 +0000 | [diff] [blame] | 14 | #include <stdlib.h> |
Alexandre Julliard | d16319c | 1999-11-25 21:30:24 +0000 | [diff] [blame] | 15 | #include "windef.h" |
Alexandre Julliard | 8081e5a | 2001-01-05 04:08:07 +0000 | [diff] [blame] | 16 | #include "server.h" |
Alexandre Julliard | 5bc7808 | 1999-06-22 17:26:53 +0000 | [diff] [blame] | 17 | |
Alexandre Julliard | 43c190e | 1999-05-15 10:48:19 +0000 | [diff] [blame] | 18 | struct process; |
| 19 | struct object_ops; |
Alexandre Julliard | 43c190e | 1999-05-15 10:48:19 +0000 | [diff] [blame] | 20 | |
| 21 | /* handle functions */ |
| 22 | |
| 23 | /* alloc_handle takes a void *obj for convenience, but you better make sure */ |
| 24 | /* that the thing pointed to starts with a struct object... */ |
Alexandre Julliard | 8081e5a | 2001-01-05 04:08:07 +0000 | [diff] [blame] | 25 | extern handle_t alloc_handle( struct process *process, void *obj, |
| 26 | unsigned int access, int inherit ); |
| 27 | extern int close_handle( struct process *process, handle_t handle, int *fd ); |
| 28 | extern struct object *get_handle_obj( struct process *process, handle_t handle, |
Alexandre Julliard | 43c190e | 1999-05-15 10:48:19 +0000 | [diff] [blame] | 29 | unsigned int access, const struct object_ops *ops ); |
Alexandre Julliard | 8081e5a | 2001-01-05 04:08:07 +0000 | [diff] [blame] | 30 | extern int get_handle_fd( struct process *process, handle_t handle, unsigned int access ); |
| 31 | extern handle_t duplicate_handle( struct process *src, handle_t src_handle, struct process *dst, |
| 32 | unsigned int access, int inherit, int options ); |
| 33 | extern handle_t open_object( const WCHAR *name, size_t len, const struct object_ops *ops, |
| 34 | unsigned int access, int inherit ); |
Alexandre Julliard | eb2e77f | 1999-06-04 19:49:54 +0000 | [diff] [blame] | 35 | extern struct object *alloc_handle_table( struct process *process, int count ); |
| 36 | extern struct object *copy_handle_table( struct process *process, struct process *parent ); |
| 37 | extern void close_global_handles(void); |
Alexandre Julliard | 43c190e | 1999-05-15 10:48:19 +0000 | [diff] [blame] | 38 | |
| 39 | #endif /* __WINE_SERVER_HANDLE_H */ |