From 1dc1cf0b81b4e7f16fdd8f27bd3971d6c4ab4606 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 5 Sep 2014 19:13:56 +0200 Subject: Miscellaneous Win32 related changes * use e_util_win32_initialize() in main() to avoid code duplication * e-spinner - correct image path build under win32 * export WIN32_SERVICELIBEXECDIR when building eds, which relies on it now * update D-Bus patch and session-local.conf creation, thus D-Bus can actually autostart services --- shell/main.c | 63 +++--------------------------------------------------------- 1 file changed, 3 insertions(+), 60 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index 62d24561f3..8b193a9ae8 100644 --- a/shell/main.c +++ b/shell/main.c @@ -41,17 +41,10 @@ #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0601 #endif -#include -#include -#include -#ifndef PROCESS_DEP_ENABLE -#define PROCESS_DEP_ENABLE 0x00000001 -#endif -#ifndef PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION -#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002 -#endif +#include #include "e-util/e-util-private.h" +#include #endif @@ -431,50 +424,7 @@ main (gint argc, GError *error = NULL; #ifdef G_OS_WIN32 - gchar *path; - - /* Reduce risks */ - { - typedef BOOL (WINAPI *t_SetDllDirectoryA) (LPCSTR lpPathName); - t_SetDllDirectoryA p_SetDllDirectoryA; - - p_SetDllDirectoryA = GetProcAddress ( - GetModuleHandle ("kernel32.dll"), - "SetDllDirectoryA"); - if (p_SetDllDirectoryA) - (*p_SetDllDirectoryA) (""); - } -#ifndef _WIN64 - { - typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags); - t_SetProcessDEPPolicy p_SetProcessDEPPolicy; - - p_SetProcessDEPPolicy = GetProcAddress ( - GetModuleHandle ("kernel32.dll"), - "SetProcessDEPPolicy"); - if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) ( - PROCESS_DEP_ENABLE | - PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); - } -#endif - - if (fileno (stdout) != -1 && _get_osfhandle (fileno (stdout)) != -1) { - /* stdout is fine, presumably redirected to a file or pipe */ - } else { - typedef BOOL (* WINAPI AttachConsole_t) (DWORD); - - AttachConsole_t p_AttachConsole = - (AttachConsole_t) GetProcAddress ( - GetModuleHandle ("kernel32.dll"), "AttachConsole"); - - if (p_AttachConsole && p_AttachConsole (ATTACH_PARENT_PROCESS)) { - freopen ("CONOUT$", "w", stdout); - dup2 (fileno (stdout), 1); - freopen ("CONOUT$", "w", stderr); - dup2 (fileno (stderr), 2); - } - } + e_util_win32_initialize (); #endif /* Make ElectricFence work. */ @@ -521,13 +471,6 @@ main (gint argc, e_gdbus_templates_init_main_thread (); #ifdef G_OS_WIN32 - path = g_build_path (";", _e_get_bindir (), g_getenv ("PATH"), NULL); - - if (!g_setenv ("PATH", path, TRUE)) - g_warning ("Could not set PATH for Evolution and its child processes"); - - g_free (path); - if (register_handlers || reinstall || show_icons) { _e_win32_register_mailer (); _e_win32_register_addressbook (); -- cgit v1.2.3