Tor Lillqvist [Thu, 22 Oct 2009 10:19:23 +0000 (13:19 +0300)]
Handle also WinSock errors in _dbus_error_from_errno
Handle those WinSock errors that match the errno values handled. Don't
bother handling those errors that are mapped to DBUS_ERROR_FAILED in
the switch as that is the default return value anyway.
Frank Osterfeld [Thu, 22 Oct 2009 10:03:11 +0000 (13:03 +0300)]
Windows fixes
Replace dbus_daemon_init() by dbus_publish_session_bus_address(),
publishing the full address. Omit username from mutexes (not necessary
as mutex names are local to session). Don't exit if publishing the
address failed (allow multiple session bus instances per
session). Based on 00ee92ae314 by Tor Lillqvist.
Cherry-picked from commit 23945513e9a4da61d286ebfbce3897aa061ddbfe in
the dbus4win repository by tml@iki.fi. Remove claim of that commit not
being merged from README.dbus4win.
Tor Lillqvist [Thu, 22 Oct 2009 00:22:54 +0000 (03:22 +0300)]
Avoid warnings on Windows
Remove unused functions, or put in #if 0 if potentially useful. Make
internal functions used just in one file static. Use -Werror after all
also on Windows. Construct the installation root from the location of
the dbus DLL, not from the location of the program .exe of the
process.
Tor Lillqvist [Wed, 21 Oct 2009 18:52:59 +0000 (21:52 +0300)]
Don't use DBUS_DIR_SEPARATOR
I didn't cherry-pick the commit from dbus4win that introduced
DBUS_DIR_SEPARATOR, as I think it just uglifies the code with little
gain. (Forward) slashes work fine on Windows.
Tor Lillqvist [Wed, 21 Oct 2009 12:31:34 +0000 (15:31 +0300)]
Use multi-byte string functions on Windows
Don't walk through char arrays that contain strings in the system
codepage char by char looking for '\\'. There are double-byte
characters in East Asian codepages where the second byte is a '\\'.
(cherry picked from commit 61316262da466993abbcba010c6bac90bb0b1d43)
Frank Osterfeld [Wed, 21 Oct 2009 17:08:12 +0000 (20:08 +0300)]
Improve error handling in nonce code
Replace errno (from assuan code) by DBusError. Errors are not passed
through dbus_accept_with_nonce atm, as the original _dbus_accept() has
no error arg either.
bus/Makefile.am: make dbus-daemon and friends bin_PROGRAMS on Windows
On Linux, dbus-daemon and dbus-daemon-launch-helper are treated specially
because they need permission adjustment.
On Windows, all executables are stubs, created by libtool. The real
executables are in .libs. We need to use libtool to install them
properly. So let's make them bin_PROGRAMS on Windows.
(cherry picked from commit 7fb35992d67433ac3ba82e9e2e786e123323456d)
Move some functions from dbus-sysdeps-util-win.c to dbus-sysdeps-win.c
These are used by dbus-sysdeps-win.c and it is not linked together
with dbus-sysdeps-util-win.c
(cherry picked from commit 24b612adbf8045b8b00af15f8d44eb38f964641f)
Marc Mutz [Fri, 17 Apr 2009 12:07:25 +0000 (14:07 +0200)]
WIN32: add versioninfo, and export symbols
* dbus/versioninfo.rc.in: (new file) copied and modified from libgpg-error
* configure.in: enable libtool's W32 support, extract version information
for use in versioninfo.rc.in, define DBUS_WIN, define DBUS_UNIX only on
unix (adapted from libgpg-error)
* dbus/Makefile.am: switch sources depending on platform,
compile versioninfo.rc, add dbus-1.def (not used since buildsystem creates
its own .def file apparently)
(cherry picked from commit cfa717ddb7b9258a862d87cd5b3bdbe582ce106c)
Frank Osterfeld [Wed, 29 Apr 2009 16:03:32 +0000 (18:03 +0200)]
_dbus_get_install_root assumes that dbus-daemon is in a bin/ subdirectory. That's not a common directory structure on windows, so weaken the assumption: $somepath/bin/dbus-daemon.exe -> $somepath $somepath/dbus-daemon.exe, where somepath doesn't end in /bin/: -> $somepath i.e., use dbus-daemon.exe's directory as root if that directory is not a "bin" directory (cherry picked from commit 2d2055b2fa7f92c144e9a182a9a091ebe5215d7d)
Tor Lillqvist [Wed, 22 Apr 2009 14:35:43 +0000 (16:35 +0200)]
dbus/dbus-sysdeps-util-win.c: use GetFileAttributes instead of CreateFile in _dbus_file_exists (cherry picked from commit 3ba582b91361785c3eb0121e8b9e85d046eea75f)
Tor Lillqvist [Wed, 22 Apr 2009 11:35:11 +0000 (13:35 +0200)]
dbus/dbus-sysdeps-win.c: add _dbus_win_error_string, and use after MoveFileEx instead of _dbus_error_from_errno (cherry picked from commit 1d0b2dacf52faffbeba09af2b309683ccc71547a)
Tor Lillqvist [Wed, 22 Apr 2009 07:20:04 +0000 (09:20 +0200)]
dbus/dbus-connection.c: use dbus_message_type_to_string instead of printing the naked message type (cherry picked from commit 33d858e83e3cb1f55ed257ffef930b8f49c3ffc7)
Fix broken Windows implementation of _dbus_printf_string_upper_bound().
Pass the correct buffer size when trying again, and keep trying with
larger buffer sizes, doubling the size each time.
(cherry picked from commit 95832a94607eea609de994467b7d64e36af72e6b)
Fix DBusMessage compiler warnings by adding some missing casts.
Basically the case where the address of a const pointer is passed as a non-const void pointer.
(cherry picked from commit dab3ec2abe7fbeea4dab873c8575a45b3b18882d)