blob: 18d5d2a5a5408d48f313dc1cddb14ff94f47cb89 [file] [log] [blame]
Alexandre Julliard43c190e1999-05-15 10:48:19 +00001/*
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 Julliard5bc78081999-06-22 17:26:53 +000014#include <stdlib.h>
Alexandre Julliardd16319c1999-11-25 21:30:24 +000015#include "windef.h"
Alexandre Julliard8081e5a2001-01-05 04:08:07 +000016#include "server.h"
Alexandre Julliard5bc78081999-06-22 17:26:53 +000017
Alexandre Julliard43c190e1999-05-15 10:48:19 +000018struct process;
19struct object_ops;
Alexandre Julliard43c190e1999-05-15 10:48:19 +000020
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 Julliard8081e5a2001-01-05 04:08:07 +000025extern handle_t alloc_handle( struct process *process, void *obj,
26 unsigned int access, int inherit );
27extern int close_handle( struct process *process, handle_t handle, int *fd );
28extern struct object *get_handle_obj( struct process *process, handle_t handle,
Alexandre Julliard43c190e1999-05-15 10:48:19 +000029 unsigned int access, const struct object_ops *ops );
Alexandre Julliard8081e5a2001-01-05 04:08:07 +000030extern int get_handle_fd( struct process *process, handle_t handle, unsigned int access );
31extern handle_t duplicate_handle( struct process *src, handle_t src_handle, struct process *dst,
32 unsigned int access, int inherit, int options );
33extern handle_t open_object( const WCHAR *name, size_t len, const struct object_ops *ops,
34 unsigned int access, int inherit );
Alexandre Julliardeb2e77f1999-06-04 19:49:54 +000035extern struct object *alloc_handle_table( struct process *process, int count );
36extern struct object *copy_handle_table( struct process *process, struct process *parent );
37extern void close_global_handles(void);
Alexandre Julliard43c190e1999-05-15 10:48:19 +000038
39#endif /* __WINE_SERVER_HANDLE_H */