Commit Graph

252 Commits

Author SHA1 Message Date
Alexandre Julliard 6f2ed23c16 server: Retrieve ioctl data directly from the request. 2015-05-06 08:44:29 +09:00
Francois Gouget f4c7e6d607 server: Treat ENOTSUP the same way as ENOLCK, consider locking to be non-functional on that filesystem. 2014-06-18 19:55:33 +02:00
Vincent Povirk 473a3a47a7 server: Try to get a read lock if we can't get a write lock. 2014-05-09 14:16:19 +02:00
Erich E. Hoover d2e216f462 server: Create directories with the specified security attributes. 2013-11-21 19:44:45 +01:00
Huw Davies b47a391e93 server: Android declares syscall() in sys/syscall.h . 2013-09-26 18:15:14 +02:00
Alexandre Julliard 39644bb309 server: Pass a wait queue entry to the signaled/satisfied object functions. 2013-08-27 23:48:36 +02:00
André Hentschel 89e462b141 server: Add checks for DragonFly BSD. 2012-05-29 10:46:34 +02:00
Alexander Morozov d0451f6b3f server: Fix overlapping shared and exclusive locks support. 2011-10-12 17:10:54 +02:00
Alexandre Julliard b00d60f125 server: Only check read/write-specific access bits for file sharing access checks. 2011-07-01 18:33:33 +02:00
Alexandre Julliard 200f8d958f server: Reuse existing file descriptor objects for duplicate file mappings. 2011-04-19 18:29:24 +02:00
Alexandre Julliard 35431ed0e7 server: Check sharing options when duplicating an fd object. 2011-04-18 13:41:32 +02:00
Alexandre Julliard 0ae3816264 server: Use the syscall function instead of inline assembly. 2010-12-23 16:10:12 +01:00
Alexandre Julliard d771f4d17c server: Return an error in get_handle_unix_name for objects that don't have a file name.
This way we fall back to retrieving the Win32 name.
2010-10-19 17:03:40 +02:00
Mike Kaplinskiy ae5ad61fa8 server: Add accept_into_socket to accept into an initialized socket. 2010-08-31 14:23:49 +02:00
Alexandre Julliard a2ca2ebd50 server: Change the removable fd flag to a cacheable flag to make it possible for fd users to set it dynamically. 2010-08-23 17:09:45 +02:00
Alexandre Julliard 7d1d002d4c server: Set a proper error code when dup_fd_object fails. 2010-04-01 18:12:58 +02:00
Alexandre Julliard 151446a2a6 server: Improve parameter checks when opening a directory. 2009-12-08 12:18:44 +01:00
Alexandre Julliard 42806f32e9 server: Add support for opening files from a specified root directory. 2009-12-01 17:38:24 +01:00
Albert Lee 01b972d639 server: Support event ports on Solaris. 2009-11-24 15:53:37 +01:00
Alexandre Julliard 181b3cf07f server: Implement the file sharing check for delete on close with an existing image mapping. 2009-11-23 17:29:22 +01:00
Alexandre Julliard 923d582f07 server: Implement the file sharing check when truncating a file that has an existing mapping. 2009-11-23 17:24:45 +01:00
Alexandre Julliard fd504b6289 server: Implement the special file sharing rules for memory mappings. 2009-11-23 17:10:28 +01:00
Alexandre Julliard 5f808f03e1 server: Store a duplicate of the file descriptor for file mappings. 2009-11-23 16:30:00 +01:00
Henri Verbeet 27705d51e1 server: Store the Unix name in the fd. 2009-11-12 15:31:38 +01:00
Michael Stefaniuc 0eed4405de server: A signed 1-bit bitfield doesn't make much sense; use unsigned. 2009-10-01 11:34:42 +02:00
Mike Kaplinskiy b05774ee7e server: Change cancel_async to take an optional iosb and only_thread. 2009-08-18 12:26:30 +02:00
Alexandre Julliard 7a344c14af server: Avoid a crash when trying to wait on a disconnected pipe client. 2009-06-09 17:01:13 +02:00
Alexandre Julliard 50171c5cc1 server: Make the new named pipe server fd inherit the I/O completion if it was set before connecting. 2009-03-03 11:59:29 +01:00
Alexandre Julliard 7ec95c5bee server: Explicitly specify when an ioctl call needs to be blocking. 2008-12-30 20:37:20 +01:00
Alexandre Julliard 9ed42d2709 server: Get rid of the unused count parameter in fd_queue_async(). 2008-12-26 12:33:31 +01:00
Alexandre Julliard a7b3efde0e server: Store the async handle inside the async_data_t structure. 2008-12-26 12:33:21 +01:00
Alexandre Julliard dc7f170495 server: Add an apc_param_t type to store APC client-side parameters. 2008-12-15 13:29:38 +01:00
Jeff Zaroyko afce615830 wineserver: Don't use O_CREAT and O_EXCL when attempting to open directories. 2008-12-03 09:58:21 +01:00
Petr Sumbera f4575aaa5f server: Workaround for conflict between Wine and Solaris list.h. 2008-04-11 11:14:33 +02:00
Alexandre Julliard a319263230 server: Don't access the process after send_client_fd as it may have been killed. 2008-02-19 16:51:16 +01:00
Andrey Turkin 3afbee5218 server: Store I/O completion information in async structure.
This is to allow completions to be sent on handle close. Also this can
be helpful for AcceptEx/TransmitFile implementation.
2007-12-18 14:25:43 +01:00
Andrey Turkin f1dcf4bf3a server: I/O completion ports can only be used with overlapped I/O. 2007-12-17 11:49:32 +01:00
Alexandre Julliard 8382eb01b2 server: Return correct object types in the get_directory_entry request. 2007-12-05 18:16:42 +01:00
Dmitry Timoshkov f2213dd23f server: Make fd_poll_event static. 2007-12-04 18:40:51 +01:00
Andrey Turkin 27cb7c7274 ws2_32: Make certain winsock functions generate i/o completion messages. 2007-11-15 14:23:23 +01:00
Andrey Turkin c702a91a3c server: Allow async i/o operations to send completion messages. 2007-11-15 14:20:29 +01:00
Rob Shearman c1707d8938 server: Add get_sd and set_sd object operations to allow the security descriptor to be stored somewhere other than server memory, such as on disk. 2007-10-04 12:30:52 +02:00
Alexandre Julliard 24001e8ddc server: Add a default access mapping function for files, and use it for devices too. 2007-10-02 14:20:15 +02:00
Andrey Turkin d1a8155882 server: Allow completion object to be attached to an fd object. 2007-09-28 13:17:18 +02:00
Alexandre Julliard 8765a0da83 ntdll: Fixed file system name comparison on *BSD. 2007-08-29 12:02:13 +02:00
Alexandre Julliard 60901b7542 server: Don't crash when trying to set a file lock on a device. 2007-06-20 13:14:55 +02:00
Alexandre Julliard 8143d42c4c server: Enable kqueue support on Mac OS >= 10.5 now that it's fixed. 2007-06-15 12:41:43 +02:00
Alexandre Julliard fd59e158a7 server: Infrastructure to return a wait handle for blocking ioctls. 2007-05-03 17:43:18 +02:00
Alexandre Julliard 017480d4e2 server: Store valid file options in pseudo file descriptors. 2007-05-03 16:07:30 +02:00
Gerald Pfeifer d529c63ced server: Silence compiler warning in fd_queue_async(). 2007-04-23 13:54:31 +02:00
Alexandre Julliard c18e8d6a69 server: Use the standard file descriptor wait queue for named pipe server async waits. 2007-04-18 16:28:01 +02:00
Alexandre Julliard f3fbae4546 server: Allow specifying the status code to return on file descriptors that don't have a Unix fd. 2007-04-18 16:05:59 +02:00
Alexandre Julliard 737148c57b server: Add a specific data type for ioctl codes so they can be printed as symbols. 2007-04-17 22:06:13 +02:00
Alexandre Julliard aaf477f292 server: Change the timeout handling to use NT-style 64-bit timeouts everywhere. 2007-04-17 20:08:59 +02:00
Alexandre Julliard 2669af73df server: Move the server part of device unmounting to the ioctl processing. 2007-04-16 14:54:52 +02:00
Alexandre Julliard 635714397f server: Add infrastructure for ioctl server request. 2007-04-16 14:45:03 +02:00
Alexandre Julliard 3f0575943e server: Don't bother with default entry points for objects that don't even return an fd. 2007-04-12 20:21:53 +02:00
Alexandre Julliard d85121f199 ntdll: Store the file access and options in the fd cache, and get rid of the dynamic flags.
This avoids server round-trips for all file I/O.
2007-04-10 22:32:46 +02:00
Alexandre Julliard 7a9363a4d4 server: Rename the get_file_info function to get_fd_type and get rid of the flags. 2007-04-10 22:26:23 +02:00
Alexandre Julliard f85437c57f server: Store the opening options in the file descriptor instead of in the individual objects.
Allows moving the FD_FLAG_OVERLAPPED support to the generic
get_handle_fd request handling.
2007-04-10 22:25:07 +02:00
Alexandre Julliard 72bff2e445 server: Add support for restarting an async I/O when the client side couldn't finish it right away. 2007-04-10 17:07:27 +02:00
Alexandre Julliard ba896e75d7 server: Fix the handling of the signaled status for file descriptors.
File handles are signaled when an I/O operation completes, and reset
when another operation is queued.
2007-04-04 19:39:29 +02:00
Alexandre Julliard b2cba95abd server: Hold a pointer to the queue from the async operations. 2007-04-03 19:36:07 +02:00
Alexandre Julliard 0aae1ca8bf server: Add a separate function to set the timeout of an async I/O operation. 2007-04-02 20:41:59 +02:00
Alexandre Julliard 02ed704be1 server: Check file access in register_async before calling the object method. 2007-04-02 20:24:55 +02:00
Alexandre Julliard df09ac5194 server: Make async I/O queues into real objects. 2007-04-02 20:09:29 +02:00
Alexandre Julliard e92f85474f server: Avoid redundant polling in fd_queue_async_timeout.
Moved the file overlapped flag check to default_fd_queue_async.
2007-04-02 12:48:13 +02:00
Alexandre Julliard 95ba4b553c server: Add a generic wait queue to the file descriptor object. 2007-04-02 12:47:52 +02:00
Alexandre Julliard df651875ad server: Remove the return value of the flush() method, it's not used. 2007-03-27 16:51:44 +02:00
Alexandre Julliard 589ce2bb8d server: Always return STATUS_PENDING when an async I/O operation has been queued. 2007-03-26 19:13:21 +02:00
Alexandre Julliard 94655c8493 server: Implemented the open_file method for named pipe and mailslot devices. 2007-03-22 11:52:40 +01:00
Alexandre Julliard 7e71c1ddee server: Add an open_file() function to the object operations. 2007-03-22 11:44:29 +01:00
Alexandre Julliard 111610c45e server: Add an async_data_t structure to store parameters for async I/O requests. 2007-03-20 20:21:12 +01:00
Alexandre Julliard 06db705238 server: Make struct async into a real object, to keep it around while the APC is running. 2007-03-20 19:23:59 +01:00
Andrew Talbot b1788c8462 server: Replace inline static with static inline. 2007-03-17 20:05:05 +01:00
Alexandre Julliard 5bd513640b ntdll: Moved the check for removable file in load_dll to the server. 2007-01-12 14:42:43 +01:00
Alexandre Julliard 5c8421d3e7 server: Add a generic apc_call structure to make it easier to extend, and more type-safe. 2007-01-04 13:40:09 +01:00
Alexandre Julliard 8930427b21 server: Return an fd type in the get_handle_fd request. 2006-11-20 14:14:04 +01:00
Gerald Pfeifer 35f0a41629 server: Compilation fix. 2006-11-06 12:27:12 +01:00
Alexandre Julliard 715d78e006 server: Refuse to close handles in other processes if they have an associated fd. 2006-11-02 20:52:22 +01:00
Alexandre Julliard 8700c4341b server: Get rid of the server-side file descriptor cache management. 2006-11-02 20:52:05 +01:00
Alexandre Julliard 28418cc919 ntdll: Maintain a file descriptor cache on the client side. 2006-11-02 20:48:19 +01:00
Alexandre Julliard 30b878b3b6 server: Compute the removable device flag on the server side. 2006-11-01 13:28:05 +01:00
Alexandre Julliard 01dd1ffdc2 ntdll: Implement FSCTL_DISMOUNT_VOLUME for MacOSX. 2006-10-03 14:54:21 +02:00
Alexandre Julliard 753c8706f5 server: Only call gettimeofday once per poll loop. 2006-08-10 16:42:09 +02:00
Alexandre Julliard c82789264b server: Added support for kqueue() as an alternative to poll() on FreeBSD. 2006-08-04 22:11:00 +02:00
Alexandre Julliard 2f4072740e server: Abstract the epoll functions a bit more. 2006-08-03 19:56:55 +02:00
Alexandre Julliard 4d1d49b78a server: Round up the timeout for poll() to avoid redundant calls. 2006-07-27 14:39:50 +02:00
Alexandre Julliard 40723f795b server: Make the create_async function take an absolute timeout. 2006-07-26 11:47:42 +02:00
Alexandre Julliard 0fa7170dc3 server: Fixed a compiler warning on MacOSX. 2006-06-15 14:14:31 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Eric Pouech 2e0b5336f6 Suppress some false-positives reported by valgrind. 2006-01-27 16:17:51 +01:00
Alexandre Julliard 8b0feb253b server: Make the FILE_SHARE_DELETE sharing checks depend on DELETE
access instead of on the FILE_DELETE_ON_CLOSE flag (based on a patch
by Mike McCormack).
2006-01-27 15:50:38 +01:00
Alexandre Julliard 471782ae29 server: Allow opening a directory with write access (based on a patch
by Mike McCormack).
2006-01-25 15:06:48 +01:00
Mike McCormack 9a7124e815 server: Modify open_fd to create an fd without a user.
Create a set_fd_user function.
Update create_file() to use the above functions.
2006-01-24 13:30:55 +01:00
Mike McCormack 213e01e606 server: Make sure to release the fd we grabbed in all cases. 2006-01-17 13:13:14 +01:00
Alexandre Julliard 770c4a1551 server: Don't enable polling on regular files in add_queue. 2005-12-12 17:20:03 +01:00
Alexandre Julliard a510a7e117 server: Added access rights mapping to file objects. 2005-12-12 16:46:17 +01:00
Alexandre Julliard 28beba31d6 server: Added infrastructure for access rights mapping. 2005-12-12 14:57:40 +01:00
Alexandre Julliard 67505c00af server: Support for opening devices.
Added support for opening devices directly with the server when they
don't correspond to a Unix file.
2005-12-12 14:27:45 +01:00
Ge van Geldorp 1a1583a364 Match PSDK STATUS_* definitions. 2005-11-28 17:32:54 +01:00
Vitaliy Margolen baffcb95d3 Add name_lookup function in object_ops. 2005-11-22 14:55:42 +00:00
Alexandre Julliard f8037bddce Make the unmount_device request take a handle to the device file
itself instead of a handle to a file opened on the device.
2005-10-27 11:20:50 +00:00
Alexandre Julliard f62f6e8fe1 Don't cache file descriptors open on removable devices. 2005-08-24 18:33:50 +00:00
Alexandre Julliard 964815bc42 Added an unmount_device request that invalidates all file descriptors
open on a given Unix device.
2005-08-08 15:11:03 +00:00
Alexandre Julliard 49b7fdcfc0 Removed the broken mmap64 configure check, and moved the
_FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that
need the define include it.
2005-08-03 21:25:10 +00:00
Alexandre Julliard d4325152db Added a separate device object to keep track of inodes that are on the
same device.
2005-07-30 19:09:43 +00:00
Alexandre Julliard c132542470 Renamed fd to unix_fd in the closed_fd structure to make the code a
bit clearer.
2005-07-28 10:48:57 +00:00
Robert Shearman 37773dda84 Make mailslots use as much of the default async fd implementation as
possible.
2005-07-14 12:18:05 +00:00
Mike McCormack 390bc5f52f Don't include winbase.h when it's not necessary. 2005-06-21 09:46:15 +00:00
Mike McCormack 66e5ce3066 Remove unnecessary includes. 2005-06-20 10:35:36 +00:00
Robert Shearman 3795709344 Change code style of form "if( x )" to "if (x)" for consistency. 2005-06-10 19:54:46 +00:00
Alexandre Julliard b9b1ea9c9f Added a close_handle method to the object operations, and use it to
implement registry notifications and the strange behavior of
CloseHandle on winstation/desktop handles.
2005-06-09 15:39:52 +00:00
Robert Shearman d6a4e34a60 - Add a default asynchronous I/O implementation.
- Make file objects use it.
2005-06-07 20:09:01 +00:00
Robert Shearman c516571481 - Use NULL instead of 0 for all non-handle pointers.
- Fix non-ANSI function declarations.
- Make a function static.
2005-05-25 18:41:09 +00:00
Mike McCormack f92fff66a2 Implemented NtSignalAndWaitForSingleObject. 2005-04-24 17:35:52 +00:00
Eric Pouech 7001d6ed34 Clean-up async IO internal functions. 2005-03-29 11:40:10 +00:00
Steven Edwards 5727918424 Added a check for poll.h. 2005-03-04 12:38:36 +00:00
Alexandre Julliard aa34768677 Convert the object wait queue to a standard list. 2005-03-01 11:49:58 +00:00
Alexandre Julliard b1aad5d86f Regular files are always ready for I/O, no need to poll on them. 2005-02-25 14:02:20 +00:00
Alexandre Julliard dd81ac50a9 Convert async I/O queues to standard lists. 2005-02-24 17:06:31 +00:00
Alexandre Julliard e432d54fd7 Fixed potential crash in fd_dump function. 2005-02-03 10:45:18 +00:00
Eric Pouech 4634447d6b - got rid of include/async.h
- fixed some overlapped issues in socket handling
- moved kernel32.CancelIo implementation to ntdll
2005-01-14 19:54:38 +00:00
Peter Chapman 505dfdefb5 Fix up several inline assembler blocks so that they produce correct
code with the -fomit-frame-pointer gcc flag.
2004-12-02 18:19:25 +00:00
Alexandre Julliard 626aa3366f Added fallback syscalls for epoll functions. 2004-10-27 01:03:30 +00:00
Alexandre Julliard 969f57c24a Added support for epoll() as an alternative to poll() (based on the
work of Shachar Shemesh and Mike McCormack).
2004-09-23 04:48:24 +00:00
Alexandre Julliard 4949a717c4 Moved timeout processing to a separate function. 2004-09-20 19:14:35 +00:00
Alexandre Julliard 17c775f13c Take care to not close the file handle if there are outstanding locks
and the directory options don't match.
2004-09-09 00:28:36 +00:00
Alexandre Julliard 15e12daf03 Converted the timeout list to use the standard list functions. 2004-09-08 04:17:31 +00:00
Alexandre Julliard 0a6af13982 Make sure to run through the poll loop once before processing newly
added timers (reported by Mike McCormack).
2004-09-07 23:28:14 +00:00
Alexandre Julliard 6a27b48895 Fd type is no longer used, get rid of it. 2004-08-18 00:04:58 +00:00
Alexandre Julliard 60287d0ac2 Make sure we don't truncate the file on open before we have checked
the sharing modes (thanks to Dmitry Timoshkov for the test case).
2004-05-22 03:15:04 +00:00
Alexandre Julliard ad9b799324 Reimplemented CreateDirectoryW and RemoveDirectoryW using ntdll
functions.
2004-04-27 02:27:09 +00:00
Alexandre Julliard 684b65cd52 Added support for FILE_DIRECTORY_FILE and FILE_NON_DIRECTORY_FILE open
options.
2004-04-16 04:31:35 +00:00
Alexandre Julliard 18c08d307a Removed the get_file_info request. 2004-04-08 19:09:04 +00:00
Alexandre Julliard 9ff78729fa Moved FILE_DELETE_ON_CLOSE support to the inode object so that we
really wait for the last close.
Added FILE_SHARE_DELETE support.
2004-04-02 19:50:49 +00:00
Alexandre Julliard 74bd1e47ed Check file sharing permissions based on the file inode instead of the
file name.
Added regression test for sharing permissions.
2004-03-27 20:48:42 +00:00
Wim Lewis 99a01c03d3 EOVERFLOW does not exist on OpenBSD. 2004-01-02 20:11:35 +00:00
Alexandre Julliard f3f435ffa1 Added wine_server_release_fd function to release the fd returned by
wine_server_handle_to_fd. Fixed a couple of potential fd leaks.
2003-12-01 23:01:12 +00:00
Alexandre Julliard b23aa94321 One more workaround for a missing NFS lock daemon. 2003-07-03 18:12:02 +00:00
Eric Pouech 412d37f6e6 - adapted kernel32 so that it no longer (directly) manages console
handles as wineserver handles
- console input handle object is no longer waitable (input record
  synchronisation is now implemented as a simple semaphore), and removed
  FD_TYPE_CONSOLE from fd types in wineserver
- console handles now always have their two lower bit set so one can
  distinguish a console handle from a kernel object handle
- implemented some undocumented kernel32 console related APIs
  (CloseConsoleHandle, GetConsoleInputWaitHandle, OpenConsoleW,
  VerifyConsoleIoHandle, DuplicateConsoleHandle)
- allowed a few kernel32 APIs to take console pseudo-handles
  (FlushFileBuffer, GetFileType, WaitFor*Object*)
- simplified the console inheritance at process creation
- in console tests, no longer create a console if one already exists
2003-06-21 02:07:10 +00:00
Mike McCormack ef8b94622a - rewrite of the named pipe code
- allow NtFileFlushBuffers to wait
- allow DisconnectNamedPipe to invalidate client cached fd
- fix the pipe test now that one extra test passes
2003-05-15 04:22:45 +00:00
Alexandre Julliard b932723a8c Ignore locking failures caused by missing NFS locking daemon.
Handle EINVAL the same way as EOVERFLOW.
2003-05-11 02:45:33 +00:00
Bill Medland 3f7c3ff76e Fix for client accessing a named pipe after the server closes it. 2003-04-17 02:14:04 +00:00
Alexandre Julliard 9037f4bbfe Added generic signal handling mechanism based on pipes to synchronize
signals with the main poll loop.
2003-03-26 01:32:18 +00:00
Alexandre Julliard d71ba930ab Ignore fcntl failure when setting a write lock on a read only file. 2003-03-21 21:31:35 +00:00
Gerald Pfeifer 6dcc1af7fb Fix signature of open_fd(). 2003-03-18 18:26:44 +00:00
Alexandre Julliard ce61349334 Implemented file locking functions (partly based on my old Corel
patch). Added a few regression tests.
2003-03-18 05:04:33 +00:00
Alexandre Julliard 580da246f5 Added an inode object to keep track of all file descriptors open for a
given file.
Plugged a couple of potential file descriptor leaks.
2003-03-12 22:38:14 +00:00
Alexandre Julliard e66207ebfc Moved all references to file descriptors out of the generic object
structure.
Changed the poll()-related routines to deal with file descriptors
instead of objects and integrated poll support into fd.c.
2003-02-19 00:33:32 +00:00