Commit Graph

156 Commits

Author SHA1 Message Date
Alexandre Julliard 202ef6901e server: Print process/thread id instead of pointer in protocol errors. 2006-06-07 14:20:38 +02:00
Alexandre Julliard 4ec9e110b0 server: Return an error for invalid requests instead of killing the client process. 2006-05-28 18:27:02 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Alexandre Julliard c5c599d478 server: Avoid crash on startup when the configuration dir doesn't exist. 2006-03-31 13:06:04 +02:00
Alexandre Julliard 0a3646292a server: Fixed process exit code on FreeBSD. 2006-03-27 12:14:24 +02:00
Alexandre Julliard b00fb174f6 server: New scheme for cleaning up objects on server exit.
Objects stored in static variables can now be marked when they are
created and are automatically cleaned up on exit. This avoids having
to export a bunch of close_* functions.
2006-03-22 20:32:04 +01:00
Eric Pouech 2e0b5336f6 Suppress some false-positives reported by valgrind. 2006-01-27 16:17:51 +01:00
Alexandre Julliard 28beba31d6 server: Added infrastructure for access rights mapping. 2005-12-12 14:57:40 +01:00
Vitaliy Margolen 3c6bdcce53 Implement directory object in wineserver.
Implement Nt[Create|Open]DirectoryObject.
Change tests accordingly.
2005-11-29 17:21:05 +01:00
Vitaliy Margolen baffcb95d3 Add name_lookup function in object_ops. 2005-11-22 14:55:42 +00:00
Alexandre Julliard cdf92942b1 Use the proper size for the cmsg_fd structure on 64-bit plaforms. 2005-09-16 18:52:47 +00:00
Mike McCormack e659f1e60c Fix some gcc 4.0 warnings. 2005-08-09 10:37:50 +00:00
Alexandre Julliard 9ad5628639 Moved the server start time to the init_thread request and got rid of
the init_process request (based on a patch by Felix Nawothnig).
2005-07-14 10:32:46 +00:00
Alexandre Julliard 4a40b2eefb Store the global hooks table in the desktop object. 2005-07-11 18:05:50 +00:00
Alexandre Julliard 248f4b29fe Store the global atom table in the process window station. 2005-07-07 11:29:23 +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 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
Steven Edwards 5727918424 Added a check for poll.h. 2005-03-04 12:38:36 +00:00
Francois Gouget 10e3d96617 Fix a race condition in create_dir(). 2005-03-01 11:00:06 +00:00
Alexandre Julliard 0502638ee1 Convert the per-process thread list to a standard list. 2005-03-01 10:56:18 +00:00
Alexandre Julliard 52e5ac5e41 Make sure leaked objects are printed even if a file descriptor is
still open.
2005-02-03 10:46:15 +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
Alexandre Julliard a5f816c6d3 Do a protocol error instead of crashing if the reply fd has not been
set.
2004-02-05 01:48:02 +00:00
Francois Gouget 9591836ffb 'sizeof type' is best avoided as it won't always compile (e.g. 'int
main() {return sizeof int;}'). Use 'sizeof(type)' instead.
2003-06-18 19:45:22 +00:00
Alexandre Julliard 5537dbbf40 Replaced WINE_CHECK_STRUCT_MEMBER autoconf macro by the standard
AC_CHECK_MEMBERS. Added check for si_fd in siginfo_t.
2003-03-28 00:36:12 +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 7ad5be967d Added -f option to make wineserver remain in the foreground for
debugging.
Close stdin/stdout when not in the foreground (based on a patch by
Francois Gouget).
2003-03-14 04:08:42 +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
Alexandre Julliard cf27a7fa3b Changed fd operations to take a struct fd instead of a struct object.
Removed get_file_info function from object operations.
Added get_device_id request to avoid abusing get_file_info.
2003-02-14 20:27:09 +00:00
Steven Edwards 037c8a1246 Porting fixes. 2003-02-11 22:27:13 +00:00
Alexandre Julliard 91befe1d64 Made process and thread ids small integers instead of pointers. 2003-02-01 01:38:40 +00:00
Alexandre Julliard 863637b158 Started moving functions that deal with Unix file descriptors to a
separate fd object. This will be needed for file locking.
2003-01-30 00:26:44 +00:00
Alexandre Julliard 435e2e63f4 winnt.h should not be self-contained, it must depend on windef.h so
that STRICT works correctly; moved some definitions back to windef.h
where they belong, and removed a couple of definitions that don't
exist on Windows.
2002-12-10 22:56:43 +00:00
Alexandre Julliard 14e68ba7fe Added support for system-wide hooks. 2002-11-20 19:54:32 +00:00
Alexandre Julliard b3332d74b0 Converted the server to -DSTRICT. 2002-10-19 01:00:59 +00:00
Alexandre Julliard 40043ed26f Added -k option to kill an existing wineserver. 2002-08-16 20:02:15 +00:00
Alexandre Julliard 714156d7ab Fixed race condition when a thread gets killed right after starting. 2002-08-13 18:24:27 +00:00
Alexandre Julliard 4144b5b8fc Create the server directory and socket file in /tmp.
Use fcntl file locking to ensure exclusion on the server socket and to
better recover from crashes.
Flush the registry before closing the socket to avoid timeouts on the
client side.
Moved get_config_dir functionality to libwine.
2002-06-20 23:21:27 +00:00
Alexandre Julliard 5188574984 Renamed handle_t to obj_handle_t to avoid conflict with rpcdce.h. 2002-05-30 20:12:58 +00:00
Alexandre Julliard f5e0f0c60a Added timer on server exit to wait a bit for new clients.
Don't remove the socket until the registry is closed to avoid a race.
2002-04-03 22:51:18 +00:00
Francois Gouget 0763abf115 Fix warnings for Linux, FreeBSD and Solaris. 2002-04-01 21:08:16 +00:00
Alexandre Julliard 0799c1a780 Added LGPL standard comment, and copyright notices where necessary.
Global replacement of debugtools.h by wine/debug.h.
2002-03-09 23:29:33 +00:00
Mike McCormack 6f011c0847 - move async activation into the server
- implement async queues
2001-12-20 00:07:05 +00:00
Alexandre Julliard 9caa71eef4 Redesign of the server communication protocol to allow arbitrary sized
data to be exchanged.
Split request and reply structures to make backwards compatibility
easier.
Moved many console functions to dlls/kernel, added code page support,
changed a few requests to behave properly with the new protocol.
2001-11-30 18:46:42 +00:00
François Gouget 1425941e29 Fix the #include order for config.h.
Add #include "config.h" directives where needed.
2001-11-06 20:57:11 +00:00
Alexandre Julliard 516e40e154 Make sure that GetMessagePos and GetMessageTime return sane values
for all messages.
2001-10-17 17:48:49 +00:00
Francois Gouget 386cf6e342 When including 'wine/port.h', include it first.
Remove redundant 'config.h' includes.
2001-10-14 16:25:47 +00:00
Alexandre Julliard b8dd37d239 Don't create the WINEPREFIX directory if it doesn't exist. 2001-08-09 21:22:33 +00:00
Alexandre Julliard 37ec927536 Use the new protocol.def file to build the request structures.
Define protocol structures in a separate server_protocol.h file.
Removed __WINE_SERVER__ checks now that all includes are in the right
directory.
2001-07-19 00:35:37 +00:00
Alexandre Julliard 4b29d669fc Ignore EAGAIN errors in read_request. 2001-06-19 18:23:13 +00:00
Alexandre Julliard 09cc91d1a8 Make sure the process socket is non-blocking.
Don't fail if nothing ready on recvmsg for a file descriptor.
2001-04-04 00:11:13 +00:00
Alexandre Julliard e5dedb1906 Added support for nested server waits (to allow waiting in signal
handlers).
2001-03-08 01:16:41 +00:00
Alexandre Julliard 8859d77279 Create the server pipes on the client side and transfer them to the
server on thread creation.
Use a single per-process socket instead of one per thread for
transferring file handles between client and server.
2001-03-01 22:13:49 +00:00
Alexandre Julliard f52424055f New mechanism to transfer file descriptors from client to server. 2001-02-28 21:45:23 +00:00
Alexandre Julliard 67a749999a New set of macros for server calls; makes requests without variable
part somewhat faster.
2001-02-27 02:09:16 +00:00
Alexandre Julliard d90e964cee Added separate server pipe to wait on blocking server calls.
Send the complete request/reply through the request fifo instead of
just a dummy byte.
Convert error status to text in server reply tracing.
2001-02-21 04:21:50 +00:00
Alexandre Julliard 8081e5a1e5 Added handle_t type to server interface so that we can make handles
pointers later on.
Always use 0 to signal invalid handle in server requests.
2001-01-05 04:08:07 +00:00
Alexandre Julliard 63411dbde5 Avoid dup'ing file descriptors when not necessary.
Do not send fd to the client if ops->get_fd() fails.
2000-12-22 21:12:36 +00:00
Alexandre Julliard d549f6909e Use a separate FIFO pair for server requests that don't need to pass a
file descriptor.
Associate file descriptors with handles on the server side so that we
don't need to pass the fd every time the client wants to use it.
2000-12-22 02:04:15 +00:00
Alexandre Julliard 1ab243bac1 Merged the get_read_fd and get_write_fd requests. 2000-12-19 02:12:45 +00:00
Alexandre Julliard 0b6a79c961 Converted enum_key_value request to the new request mechanism. 2000-12-15 20:57:00 +00:00
Dimitrie O. Paun 2af03e45b5 Do not include sys/ptrace.h and sys/user.h unconditionally.
Other portability fixes.
2000-11-29 20:04:09 +00:00
Joerg Mayer abe635cfd7 Get rid of some warnings about unused variables, signed/unsigned
comparisons and incomplete initializations.
2000-11-11 00:38:37 +00:00
Alexandre Julliard 908464d448 Authors: Andreas Mohr <amohr@codeweavers.com>, Dimitrie O. Paun <dimi@cs.toronto.edu>, Patrik Stridvall <ps@leissner.se>
Various warning fixes.
2000-11-01 03:11:12 +00:00
Patrik Stridvall a9f6a9daec Explicitly initialize structures. 2000-10-24 02:22:16 +00:00
Alexandre Julliard 8611353053 Added the data structures and macros that will be needed to support
reentrant server requests.
2000-08-29 03:54:30 +00:00
Alexandre Julliard 6c8d9171cd Added a real root key and simplified creation of the HKEY_* special root keys.
Do not prefix all keys with the name of the top key when saving to a file.
Try to load $WINEPREFIX/config into the Wine config branch at startup.
2000-08-26 04:40:07 +00:00
Alexandre Julliard c10c9ef4f1 Made server startup more robust against races caused by a previous
server terminating at the same time.
2000-08-11 21:16:53 +00:00
Alexandre Julliard 5b4f3e8d6d Rewrote Unix process launching to allow passing startup information to
Winelib apps. Improved handling of execve() failures.
2000-05-01 16:24:22 +00:00
Alexandre Julliard d804111dc5 Made server launching somewhat cleaner and faster. 2000-04-14 14:42:41 +00:00
Alexandre Julliard de1d5ad444 Added support for WINEPREFIX environment variable. 2000-04-06 20:36:17 +00:00
Alexandre Julliard 12f29b5076 Have threads and processes exit more cleanly whenever possible. 2000-03-17 15:16:57 +00:00
Alexandre Julliard ea0d028a0b Added specific routines for OUTPUT_DEBUG_STRING and EXCEPTION debug events.
Generate a breakpoint event on process attach.
Misc cleanups in request handling.
2000-03-10 22:16:10 +00:00
Alexandre Julliard 05f0b71bb3 Store the list of loaded dlls in the server, and generate debug events
internally.
2000-03-09 18:18:41 +00:00
Patrik Stridvall 7e9913f463 Fixed some warnings. 2000-03-08 18:25:22 +00:00
Juergen Lock 2d33ab91f4 Added configure check for the unix domain sockaddr length. 2000-02-13 16:03:29 +00:00
Alexandre Julliard 2fe57779fb Made the server listen for new clients on a Unix socket in
$HOME/.wine. Newly started wine processes now attach to an existing
server if one is running.
2000-01-25 01:40:27 +00:00
Alexandre Julliard cb1fc735f0 Changed the server to return STATUS_* error codes. 2000-01-24 21:58:06 +00:00
Alexandre Julliard 9de03f4f6a Made sleep_on usable from all requests. 2000-01-04 02:23:38 +00:00
Alexandre Julliard 1dca5e24c7 Moved poll handling to the generic part of the server objects.
Fixed busy waiting on POLLERR events.
Merged struct client into struct thread.
2000-01-01 00:56:27 +00:00
Alexandre Julliard ebe29ef376 Further server optimizations:
- merged request and reply structures
- build requests directly into the buffer to avoid a copy
1999-06-26 08:43:26 +00:00
Alexandre Julliard 5bc78089db Made server communication faster by using a shared memory block.
A few other optimizations in request processing in the server.
Moved automatically generated request definitions to server.h and
removed include/server/request.h.
1999-06-22 17:26:53 +00:00
Alexandre Julliard 88de35cd70 Changed select interface, separated timeouts from file descriptors. 1999-05-16 16:57:49 +00:00
Alexandre Julliard 43c190e7ba Server reorganization:
- moved request handlers to the specific C files
- moved handle management to handle.c
- moved server private includes to server/ instead of include/server/
1999-05-15 10:48:19 +00:00
Patrik Stridvall 0f8bc5b5c7 Fixed ANSI compabillity. 1999-04-22 16:27:50 +00:00
Ulrich Weigand 371fd75a39 Added new CLIENT_DebuggerRequest routine, implemented support for
DEBUGGER_FREEZE_ALL/DEBUGGER_UNFREEZE_ALL requests.
Run wine server in the main wine process.
Bugfix: never free initial thread!
1999-04-11 17:13:03 +00:00
Alexandre Julliard 875c4b3c61 Added server pid and tid in init_thread request, and use them in
CLIENT_InitThread.
1999-03-23 14:09:41 +00:00
Alexandre Julliard f692d44607 Added new_process and init_process request.
Split out process creation from thread creation.
Changed server initialisation to ensure that we always have a current
thread.
1999-03-21 19:23:54 +00:00
Ulrich Weigand 2f2898b571 Handle suspend/resume_thread requests in phase STARTING correctly.
Set initial suspend count for threads created with CREATE_SUSPENDED.
Set 'inheritable' flag for process/thread handles.
1999-03-16 16:28:36 +00:00
David Luyer ee517e863e - fixed missing stdlib.h and string.h includes everywhere
- removed a couple of unneeded stdlib.h and stdio.h includes
1999-02-28 12:27:56 +00:00
Alexandre Julliard 875d112dd7 Removed dst_handle in duplicate_handle request.
Added inherit flag in create_mapping request.
1999-02-28 10:12:48 +00:00
Alexandre Julliard 6d4ee73906 Added get/set_handle_info request. 1999-02-20 16:13:28 +00:00
Alexandre Julliard fdc92bae07 Added server snapshot support (processes only for now). 1999-02-14 18:03:15 +00:00
Alexandre Julliard 4b461128d6 Added input queue to server-side console object,
read/write_console_input requests, and use them for
Read/WriteConsoleInput.
1999-01-31 19:04:30 +00:00
Alexandre Julliard 62a8b43301 Hacked server-side device support
Added user APCs support.
Many changes to the xterm console to make use of the server (not
finished yet).
Moved some other small stuff to the server.
1999-01-19 17:48:23 +00:00
Alexandre Julliard 0562539d18 Implemented file sharing checks in the server.
Added set file time server request.
Overall clean up of the file handling (DOS device handling is now
broken, should be redone).
1999-01-03 11:55:56 +00:00
Alexandre Julliard a6ac379b08 Fixed CHECK_STRING display. 1999-01-02 08:21:54 +00:00
Alexandre Julliard a8b8d9c0f6 Added server-side file mapping object support. 1999-01-01 16:59:27 +00:00