2003-01-29 17:26:44 -07:00
|
|
|
/*
|
|
|
|
* Server-side file definitions
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 05:49:52 -07:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-01-29 17:26:44 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_SERVER_FILE_H
|
|
|
|
#define __WINE_SERVER_FILE_H
|
|
|
|
|
2014-08-23 08:01:29 -07:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2003-01-29 17:26:44 -07:00
|
|
|
#include "object.h"
|
|
|
|
|
|
|
|
struct fd;
|
2011-04-18 05:14:40 -07:00
|
|
|
struct mapping;
|
2007-04-02 11:09:29 -07:00
|
|
|
struct async_queue;
|
2007-09-27 13:03:39 -07:00
|
|
|
struct completion;
|
2024-11-05 01:24:42 -07:00
|
|
|
struct reserve;
|
2003-01-29 17:26:44 -07:00
|
|
|
|
2017-01-25 16:51:49 -07:00
|
|
|
/* server-side representation of I/O status block */
|
|
|
|
struct iosb
|
|
|
|
{
|
|
|
|
struct object obj; /* object header */
|
|
|
|
unsigned int status; /* resulting status (or STATUS_PENDING) */
|
|
|
|
data_size_t result; /* size of result (input or output depending on the type) */
|
|
|
|
data_size_t in_size; /* size of input data */
|
|
|
|
void *in_data; /* input data */
|
|
|
|
data_size_t out_size; /* size of output data */
|
|
|
|
void *out_data; /* output data */
|
|
|
|
};
|
|
|
|
|
2017-07-04 06:26:19 -07:00
|
|
|
struct async_queue
|
|
|
|
{
|
|
|
|
struct list queue; /* queue of async objects */
|
|
|
|
};
|
|
|
|
|
2003-01-29 17:26:44 -07:00
|
|
|
/* operations valid on file descriptor objects */
|
|
|
|
struct fd_ops
|
|
|
|
{
|
|
|
|
/* get the events we want to poll() for on this object */
|
2003-02-14 13:27:09 -07:00
|
|
|
int (*get_poll_events)(struct fd *);
|
2003-07-15 13:53:39 -07:00
|
|
|
/* a poll() event occurred */
|
2003-02-14 13:27:09 -07:00
|
|
|
void (*poll_event)(struct fd *,int event);
|
2003-01-29 17:26:44 -07:00
|
|
|
/* get file information */
|
2007-04-10 13:26:23 -07:00
|
|
|
enum server_fd_type (*get_fd_type)(struct fd *fd);
|
2015-05-04 20:17:45 -07:00
|
|
|
/* perform a read on the file */
|
2021-09-02 17:08:51 -07:00
|
|
|
void (*read)(struct fd *, struct async *, file_pos_t );
|
2015-05-04 20:17:45 -07:00
|
|
|
/* perform a write on the file */
|
2021-09-02 17:08:52 -07:00
|
|
|
void (*write)(struct fd *, struct async *, file_pos_t );
|
2015-05-04 20:17:45 -07:00
|
|
|
/* flush the object buffers */
|
2021-09-02 17:08:53 -07:00
|
|
|
void (*flush)(struct fd *, struct async *);
|
2017-12-21 08:12:01 -07:00
|
|
|
/* query file info */
|
2018-10-15 04:40:36 -07:00
|
|
|
void (*get_file_info)( struct fd *, obj_handle_t, unsigned int );
|
2017-10-02 07:42:16 -07:00
|
|
|
/* query volume info */
|
2021-09-02 17:08:50 -07:00
|
|
|
void (*get_volume_info)( struct fd *, struct async *, unsigned int );
|
2007-04-16 05:45:03 -07:00
|
|
|
/* perform an ioctl on the file */
|
2021-09-02 17:08:54 -07:00
|
|
|
void (*ioctl)(struct fd *fd, ioctl_code_t code, struct async *async );
|
2021-09-03 21:11:38 -07:00
|
|
|
/* cancel an async operation */
|
|
|
|
void (*cancel_async)(struct fd *fd, struct async *async);
|
2005-01-14 12:54:38 -07:00
|
|
|
/* queue an async operation */
|
2017-02-15 14:12:45 -07:00
|
|
|
void (*queue_async)(struct fd *, struct async *async, int type, int count);
|
2007-04-10 08:07:27 -07:00
|
|
|
/* selected events for async i/o need an update */
|
|
|
|
void (*reselect_async)( struct fd *, struct async_queue *queue );
|
2003-01-29 17:26:44 -07:00
|
|
|
};
|
|
|
|
|
2003-02-14 13:27:09 -07:00
|
|
|
/* file descriptor functions */
|
|
|
|
|
2007-05-03 07:07:30 -07:00
|
|
|
extern struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user,
|
|
|
|
unsigned int options );
|
2021-02-09 06:11:07 -07:00
|
|
|
extern struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_name,
|
|
|
|
int flags, mode_t *mode, unsigned int access,
|
|
|
|
unsigned int sharing, unsigned int options );
|
2003-03-12 15:38:14 -07:00
|
|
|
extern struct fd *create_anonymous_fd( const struct fd_ops *fd_user_ops,
|
2007-04-10 13:25:07 -07:00
|
|
|
int unix_fd, struct object *user, unsigned int options );
|
2009-11-23 09:09:08 -07:00
|
|
|
extern struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sharing,
|
|
|
|
unsigned int options );
|
2011-04-19 08:19:31 -07:00
|
|
|
extern struct fd *get_fd_object_for_mapping( struct fd *fd, unsigned int access, unsigned int sharing );
|
2003-02-14 13:27:09 -07:00
|
|
|
extern void *get_fd_user( struct fd *fd );
|
2006-01-24 05:30:55 -07:00
|
|
|
extern void set_fd_user( struct fd *fd, const struct fd_ops *ops, struct object *user );
|
2007-04-10 13:25:07 -07:00
|
|
|
extern unsigned int get_fd_options( struct fd *fd );
|
2021-05-21 20:08:48 -07:00
|
|
|
extern unsigned int get_fd_comp_flags( struct fd *fd );
|
2018-10-31 08:44:56 -07:00
|
|
|
extern int is_fd_overlapped( struct fd *fd );
|
2003-02-14 13:27:09 -07:00
|
|
|
extern int get_unix_fd( struct fd *fd );
|
2023-10-05 01:41:47 -07:00
|
|
|
extern client_ptr_t get_fd_map_address( struct fd *fd );
|
|
|
|
extern void set_fd_map_address( struct fd *fd, client_ptr_t addr, mem_size_t size );
|
2004-03-27 13:48:42 -07:00
|
|
|
extern int is_same_file_fd( struct fd *fd1, struct fd *fd2 );
|
2007-01-12 06:42:43 -07:00
|
|
|
extern int is_fd_removable( struct fd *fd );
|
2003-02-14 13:27:09 -07:00
|
|
|
extern int check_fd_events( struct fd *fd, int events );
|
2003-02-18 17:33:32 -07:00
|
|
|
extern void set_fd_events( struct fd *fd, int events );
|
2003-03-17 22:04:33 -07:00
|
|
|
extern obj_handle_t lock_fd( struct fd *fd, file_pos_t offset, file_pos_t count, int shared, int wait );
|
|
|
|
extern void unlock_fd( struct fd *fd, file_pos_t offset, file_pos_t count );
|
2010-08-23 08:09:45 -07:00
|
|
|
extern void allow_fd_caching( struct fd *fd );
|
2007-04-04 10:39:29 -07:00
|
|
|
extern void set_fd_signaled( struct fd *fd, int signaled );
|
2023-01-27 12:56:55 -07:00
|
|
|
extern char *dup_fd_name( struct fd *root, const char *name ) __WINE_DEALLOC(free) __WINE_MALLOC;
|
2021-02-09 06:11:07 -07:00
|
|
|
extern void get_nt_name( struct fd *fd, struct unicode_str *name );
|
2003-01-29 17:26:44 -07:00
|
|
|
|
2013-08-26 02:55:04 -07:00
|
|
|
extern int default_fd_signaled( struct object *obj, struct wait_queue_entry *entry );
|
2005-06-07 13:09:01 -07:00
|
|
|
extern int default_fd_get_poll_events( struct fd *fd );
|
2003-02-14 13:27:09 -07:00
|
|
|
extern void default_poll_event( struct fd *fd, int event );
|
2021-09-03 21:11:38 -07:00
|
|
|
extern void fd_cancel_async( struct fd *fd, struct async *async );
|
2017-07-04 06:26:35 -07:00
|
|
|
extern void fd_queue_async( struct fd *fd, struct async *async, int type );
|
2007-04-02 11:09:29 -07:00
|
|
|
extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status );
|
2007-04-10 08:07:27 -07:00
|
|
|
extern void fd_reselect_async( struct fd *fd, struct async_queue *queue );
|
2021-09-02 17:08:51 -07:00
|
|
|
extern void no_fd_read( struct fd *fd, struct async *async, file_pos_t pos );
|
2021-09-02 17:08:52 -07:00
|
|
|
extern void no_fd_write( struct fd *fd, struct async *async, file_pos_t pos );
|
2021-09-02 17:08:53 -07:00
|
|
|
extern void no_fd_flush( struct fd *fd, struct async *async );
|
2018-10-15 04:40:36 -07:00
|
|
|
extern void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
|
2018-10-23 08:45:06 -07:00
|
|
|
extern void default_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
|
2021-09-02 17:08:50 -07:00
|
|
|
extern void no_fd_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
|
2021-09-02 17:08:54 -07:00
|
|
|
extern void no_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
|
|
|
|
extern void default_fd_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
|
2021-09-03 21:11:38 -07:00
|
|
|
extern void default_fd_cancel_async( struct fd *fd, struct async *async );
|
2017-02-15 14:12:45 -07:00
|
|
|
extern void no_fd_queue_async( struct fd *fd, struct async *async, int type, int count );
|
|
|
|
extern void default_fd_queue_async( struct fd *fd, struct async *async, int type, int count );
|
2007-04-10 08:07:27 -07:00
|
|
|
extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue );
|
2003-02-18 17:33:32 -07:00
|
|
|
extern void main_loop(void);
|
2005-06-14 04:40:40 -07:00
|
|
|
extern void remove_process_locks( struct process *process );
|
2003-02-14 13:27:09 -07:00
|
|
|
|
2007-03-17 03:52:14 -07:00
|
|
|
static inline struct fd *get_obj_fd( struct object *obj ) { return obj->ops->get_fd( obj ); }
|
2003-02-14 13:27:09 -07:00
|
|
|
|
2003-02-18 17:33:32 -07:00
|
|
|
/* timeout functions */
|
|
|
|
|
|
|
|
struct timeout_user;
|
2007-04-17 11:08:59 -07:00
|
|
|
extern timeout_t current_time;
|
2020-04-06 08:21:03 -07:00
|
|
|
extern timeout_t monotonic_time;
|
2020-05-25 11:25:50 -07:00
|
|
|
extern struct _KUSER_SHARED_DATA *user_shared_data;
|
2007-04-17 11:08:59 -07:00
|
|
|
|
|
|
|
#define TICKS_PER_SEC 10000000
|
2003-02-18 17:33:32 -07:00
|
|
|
|
|
|
|
typedef void (*timeout_callback)( void *private );
|
|
|
|
|
2020-04-06 08:21:03 -07:00
|
|
|
static inline abstime_t timeout_to_abstime( timeout_t timeout )
|
|
|
|
{
|
|
|
|
return timeout > 0 ? timeout : timeout - monotonic_time;
|
|
|
|
}
|
|
|
|
|
2020-04-06 08:21:07 -07:00
|
|
|
static inline timeout_t abstime_to_timeout( abstime_t abstime )
|
|
|
|
{
|
|
|
|
if (abstime > 0) return abstime;
|
|
|
|
return -abstime < monotonic_time ? 0 : abstime + monotonic_time;
|
|
|
|
}
|
|
|
|
|
2020-04-06 08:20:58 -07:00
|
|
|
extern void set_current_time( void );
|
2007-04-17 11:08:59 -07:00
|
|
|
extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private );
|
2003-02-18 17:33:32 -07:00
|
|
|
extern void remove_timeout_user( struct timeout_user *user );
|
2007-04-17 11:08:59 -07:00
|
|
|
extern const char *get_timeout_str( timeout_t timeout );
|
2003-02-18 17:33:32 -07:00
|
|
|
|
2003-02-14 13:27:09 -07:00
|
|
|
/* file functions */
|
|
|
|
|
|
|
|
extern struct file *get_file_obj( struct process *process, obj_handle_t handle,
|
|
|
|
unsigned int access );
|
|
|
|
extern int get_file_unix_fd( struct file *file );
|
2009-11-23 08:20:15 -07:00
|
|
|
extern struct file *create_file_for_fd( int fd, unsigned int access, unsigned int sharing );
|
2011-04-18 04:41:54 -07:00
|
|
|
extern struct file *create_file_for_fd_obj( struct fd *fd, unsigned int access, unsigned int sharing );
|
2003-02-14 13:27:09 -07:00
|
|
|
extern void file_set_error(void);
|
2022-01-25 04:27:28 -07:00
|
|
|
extern struct security_descriptor *mode_to_sd( mode_t mode, const struct sid *user, const struct sid *group );
|
|
|
|
extern mode_t sd_to_mode( const struct security_descriptor *sd, const struct sid *owner );
|
2020-03-10 20:38:25 -07:00
|
|
|
extern int is_file_executable( const char *name );
|
2003-01-29 17:26:44 -07:00
|
|
|
|
2011-04-18 04:41:54 -07:00
|
|
|
/* file mapping functions */
|
|
|
|
|
2021-02-02 02:12:56 -07:00
|
|
|
struct memory_view;
|
|
|
|
|
2023-10-05 01:41:47 -07:00
|
|
|
extern void init_memory(void);
|
2021-06-24 22:28:51 -07:00
|
|
|
extern int grow_file( int unix_fd, file_pos_t new_size );
|
2023-10-05 01:41:47 -07:00
|
|
|
extern void free_map_addr( client_ptr_t base, mem_size_t size );
|
2021-02-02 02:12:56 -07:00
|
|
|
extern struct memory_view *find_mapped_view( struct process *process, client_ptr_t base );
|
|
|
|
extern struct memory_view *get_exe_view( struct process *process );
|
|
|
|
extern struct file *get_view_file( const struct memory_view *view, unsigned int access, unsigned int sharing );
|
|
|
|
extern const pe_image_info_t *get_view_image_info( const struct memory_view *view, client_ptr_t *base );
|
2021-02-09 08:14:27 -07:00
|
|
|
extern int get_view_nt_name( const struct memory_view *view, struct unicode_str *name );
|
2017-09-26 05:11:49 -07:00
|
|
|
extern void free_mapped_views( struct process *process );
|
2011-04-18 04:41:54 -07:00
|
|
|
extern int get_page_size(void);
|
2020-11-27 08:41:07 -07:00
|
|
|
extern struct mapping *create_fd_mapping( struct object *root, const struct unicode_str *name, struct fd *fd,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
2020-05-29 03:26:57 -07:00
|
|
|
extern struct object *create_user_data_mapping( struct object *root, const struct unicode_str *name,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
2024-02-19 13:38:21 -07:00
|
|
|
extern struct mapping *create_session_mapping( struct object *root, const struct unicode_str *name,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
|
|
|
extern void set_session_mapping( struct mapping *mapping );
|
|
|
|
|
2024-05-07 00:52:18 -07:00
|
|
|
extern const volatile void *alloc_shared_object(void);
|
|
|
|
extern void free_shared_object( const volatile void *object_shm );
|
2024-02-19 14:51:54 -07:00
|
|
|
extern void invalidate_shared_object( const volatile void *object_shm );
|
2024-03-16 12:41:13 -07:00
|
|
|
extern obj_locator_t get_shared_object_locator( const volatile void *object_shm );
|
2024-05-07 00:52:18 -07:00
|
|
|
|
2024-02-19 13:38:21 -07:00
|
|
|
#define SHARED_WRITE_BEGIN( object_shm, type ) \
|
|
|
|
do { \
|
|
|
|
const type *__shared = (object_shm); \
|
|
|
|
type *shared = (type *)__shared; \
|
|
|
|
shared_object_t *__obj = CONTAINING_RECORD( shared, shared_object_t, shm ); \
|
|
|
|
LONG64 __seq = __obj->seq + 1, __end = __seq + 1; \
|
|
|
|
assert( (__seq & 1) != 0 ); \
|
|
|
|
__WINE_ATOMIC_STORE_RELEASE( &__obj->seq, &__seq ); \
|
|
|
|
do
|
|
|
|
|
|
|
|
#define SHARED_WRITE_END \
|
|
|
|
while(0); \
|
|
|
|
assert( __seq == __obj->seq ); \
|
|
|
|
__WINE_ATOMIC_STORE_RELEASE( &__obj->seq, &__end ); \
|
|
|
|
} while(0)
|
2020-05-11 04:12:48 -07:00
|
|
|
|
2015-05-21 01:19:51 -07:00
|
|
|
/* device functions */
|
|
|
|
|
2020-09-23 02:32:47 -07:00
|
|
|
extern struct object *create_named_pipe_device( struct object *root, const struct unicode_str *name,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
|
|
|
extern struct object *create_mailslot_device( struct object *root, const struct unicode_str *name,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
|
|
|
extern struct object *create_console_device( struct object *root, const struct unicode_str *name,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
|
|
|
extern struct object *create_socket_device( struct object *root, const struct unicode_str *name,
|
|
|
|
unsigned int attr, const struct security_descriptor *sd );
|
2016-07-17 23:34:08 -07:00
|
|
|
extern struct object *create_unix_device( struct object *root, const struct unicode_str *name,
|
2020-09-23 02:32:47 -07:00
|
|
|
unsigned int attr, const struct security_descriptor *sd, const char *unix_path );
|
2015-05-21 01:19:51 -07:00
|
|
|
|
2003-03-26 16:41:43 -07:00
|
|
|
/* change notification functions */
|
|
|
|
|
|
|
|
extern void do_change_notify( int unix_fd );
|
|
|
|
extern void sigio_callback(void);
|
2009-08-17 08:18:54 -07:00
|
|
|
extern struct object *create_dir_obj( struct fd *fd, unsigned int access, mode_t mode );
|
2009-12-01 09:38:24 -07:00
|
|
|
extern struct dir *get_dir_obj( struct process *process, obj_handle_t handle, unsigned int access );
|
2003-03-26 16:41:43 -07:00
|
|
|
|
2007-09-27 13:03:39 -07:00
|
|
|
/* completion */
|
|
|
|
|
2007-11-09 15:11:48 -07:00
|
|
|
extern struct completion *get_completion_obj( struct process *process, obj_handle_t handle, unsigned int access );
|
2024-11-05 01:24:42 -07:00
|
|
|
extern struct reserve *get_completion_reserve_obj( struct process *process, obj_handle_t handle, unsigned int access );
|
2008-12-15 05:29:38 -07:00
|
|
|
extern void add_completion( struct completion *completion, apc_param_t ckey, apc_param_t cvalue,
|
2013-08-23 03:37:51 -07:00
|
|
|
unsigned int status, apc_param_t information );
|
2024-10-07 17:19:57 -07:00
|
|
|
extern void cleanup_thread_completion( struct thread *thread );
|
2007-09-27 13:03:39 -07:00
|
|
|
|
2004-03-17 21:08:48 -07:00
|
|
|
/* serial port functions */
|
|
|
|
|
|
|
|
extern int is_serial_fd( struct fd *fd );
|
2007-04-10 13:25:07 -07:00
|
|
|
extern struct object *create_serial( struct fd *fd );
|
2004-03-17 21:08:48 -07:00
|
|
|
|
2005-01-14 12:54:38 -07:00
|
|
|
/* async I/O functions */
|
2021-02-08 16:40:42 -07:00
|
|
|
|
|
|
|
typedef void (*async_completion_callback)( void *private );
|
|
|
|
|
2007-04-03 10:36:07 -07:00
|
|
|
extern void free_async_queue( struct async_queue *queue );
|
2024-11-15 08:24:15 -07:00
|
|
|
extern struct async *create_async( struct fd *fd, struct thread *thread, const struct async_data *data, struct iosb *iosb );
|
|
|
|
extern struct async *create_request_async( struct fd *fd, unsigned int comp_flags, const struct async_data *data,
|
2024-09-12 19:22:52 -07:00
|
|
|
int is_system );
|
2021-09-02 17:08:49 -07:00
|
|
|
extern obj_handle_t async_handoff( struct async *async, data_size_t *result, int force_blocking );
|
2017-02-15 14:12:28 -07:00
|
|
|
extern void queue_async( struct async_queue *queue, struct async *async );
|
2007-04-17 11:08:59 -07:00
|
|
|
extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status );
|
2017-04-10 04:21:41 -07:00
|
|
|
extern void async_set_result( struct object *obj, unsigned int status, apc_param_t total );
|
2021-02-08 16:40:42 -07:00
|
|
|
extern void async_set_completion_callback( struct async *async, async_completion_callback func, void *private );
|
2021-09-02 17:08:46 -07:00
|
|
|
extern void async_set_unknown_status( struct async *async );
|
2021-09-03 21:11:42 -07:00
|
|
|
extern void set_async_pending( struct async *async );
|
2021-09-12 14:07:51 -07:00
|
|
|
extern void async_set_initial_status( struct async *async, unsigned int status );
|
|
|
|
extern void async_wake_obj( struct async *async );
|
2007-04-02 11:09:29 -07:00
|
|
|
extern int async_waiting( struct async_queue *queue );
|
2024-01-29 17:11:25 -07:00
|
|
|
extern int async_queue_has_waiting_asyncs( struct async_queue *queue );
|
2007-05-08 11:37:21 -07:00
|
|
|
extern void async_terminate( struct async *async, unsigned int status );
|
2021-09-01 15:28:38 -07:00
|
|
|
extern void async_request_complete( struct async *async, unsigned int status, data_size_t result,
|
|
|
|
data_size_t out_size, void *out_data );
|
2021-09-01 15:28:39 -07:00
|
|
|
extern void async_request_complete_alloc( struct async *async, unsigned int status, data_size_t result,
|
|
|
|
data_size_t out_size, const void *out_data );
|
2007-04-02 11:09:29 -07:00
|
|
|
extern void async_wake_up( struct async_queue *queue, unsigned int status );
|
2009-03-02 12:34:39 -07:00
|
|
|
extern struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key );
|
|
|
|
extern void fd_copy_completion( struct fd *src, struct fd *dst );
|
2017-02-15 14:12:37 -07:00
|
|
|
extern struct iosb *async_get_iosb( struct async *async );
|
2020-10-19 09:21:19 -07:00
|
|
|
extern struct thread *async_get_thread( struct async *async );
|
2017-03-23 07:41:43 -07:00
|
|
|
extern struct async *find_pending_async( struct async_queue *queue );
|
2016-12-01 04:10:47 -07:00
|
|
|
extern void cancel_process_asyncs( struct process *process );
|
2022-05-26 11:41:47 -07:00
|
|
|
extern void cancel_terminating_thread_asyncs( struct thread *thread );
|
2023-07-19 09:02:06 -07:00
|
|
|
extern int async_close_obj_handle( struct object *obj, struct process *process, obj_handle_t handle );
|
2005-01-14 12:54:38 -07:00
|
|
|
|
2017-07-04 06:26:19 -07:00
|
|
|
static inline void init_async_queue( struct async_queue *queue )
|
|
|
|
{
|
|
|
|
list_init( &queue->queue );
|
|
|
|
}
|
|
|
|
|
2017-07-04 06:26:26 -07:00
|
|
|
static inline int async_queued( struct async_queue *queue )
|
|
|
|
{
|
|
|
|
return !list_empty( &queue->queue );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-12-12 08:46:17 -07:00
|
|
|
/* access rights that require Unix read permission */
|
|
|
|
#define FILE_UNIX_READ_ACCESS (FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA)
|
|
|
|
|
|
|
|
/* access rights that require Unix write permission */
|
2013-10-01 22:01:28 -07:00
|
|
|
#define FILE_UNIX_WRITE_ACCESS (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_ATTRIBUTES|FILE_WRITE_EA)
|
2005-12-12 08:46:17 -07:00
|
|
|
|
2009-11-23 09:09:08 -07:00
|
|
|
/* magic file access rights for mappings */
|
2009-11-23 09:24:09 -07:00
|
|
|
#define FILE_MAPPING_IMAGE 0x80000000 /* set for SEC_IMAGE mappings */
|
|
|
|
#define FILE_MAPPING_WRITE 0x40000000 /* set for writable shared mappings */
|
|
|
|
#define FILE_MAPPING_ACCESS 0x20000000 /* set for all mappings */
|
2009-11-23 09:09:08 -07:00
|
|
|
|
2003-01-29 17:26:44 -07:00
|
|
|
#endif /* __WINE_SERVER_FILE_H */
|