handle.h 2.87 KB
Newer Older
1 2 3 4
/*
 * Server-side handle definitions
 *
 * Copyright (C) 1999 Alexandre Julliard
5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22 23
 */

#ifndef __WINE_SERVER_HANDLE_H
#define __WINE_SERVER_HANDLE_H

24
#include <stdlib.h>
25
#include "windef.h"
26
#include "wine/server_protocol.h"
27

28 29
struct process;
struct object_ops;
30
struct namespace;
31
struct unicode_str;
32 33 34 35 36

/* handle functions */

/* alloc_handle takes a void *obj for convenience, but you better make sure */
/* that the thing pointed to starts with a struct object... */
37
extern obj_handle_t alloc_handle( struct process *process, void *obj,
38
                                  unsigned int access, unsigned int attr );
39 40
extern obj_handle_t alloc_handle_no_access_check( struct process *process, void *ptr,
                                                  unsigned int access, unsigned int attr );
41
extern unsigned int close_handle( struct process *process, obj_handle_t handle );
42
extern struct object *get_handle_obj( struct process *process, obj_handle_t handle,
43
                                      unsigned int access, const struct object_ops *ops );
44
extern unsigned int get_handle_access( struct process *process, obj_handle_t handle );
45
extern obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, struct process *dst,
46
                                      unsigned int access, unsigned int attr, unsigned int options );
47 48 49
extern obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned int access,
                                 const struct object_ops *ops, const struct unicode_str *name,
                                 unsigned int attr );
50
extern obj_handle_t find_inherited_handle( struct process *process, const struct object_ops *ops );
51 52
extern obj_handle_t enumerate_handles( struct process *process, const struct object_ops *ops,
                                       unsigned int *index );
53
extern void close_process_handles( struct process *process );
54 55
extern struct handle_table *alloc_handle_table( struct process *process, int count );
extern struct handle_table *copy_handle_table( struct process *process, struct process *parent );
56 57
extern unsigned int get_handle_table_count( struct process *process);

58
#endif  /* __WINE_SERVER_HANDLE_H */