No issues found
Tool | Failure ID | Location | Function | Message | Data |
---|---|---|---|---|---|
clang-analyzer | no-output-found | notify-main.c | Message(text='Unable to locate XML output from invoke-clang-analyzer') | None |
1 /*
2 * Evolution calendar - Alarm notification service main file
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
16 *
17 *
18 * Authors:
19 * Federico Mena-Quintero <federico@ximian.com>
20 * Rodrigo Moya <rodrigo@ximian.com>
21 *
22 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
23 *
24 */
25
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #include <stdlib.h>
31 #include <glib/gi18n.h>
32
33 #include "alarm-notify.h"
34
35 #ifdef G_OS_WIN32
36 #include <windows.h>
37 #include <conio.h>
38 #ifndef PROCESS_DEP_ENABLE
39 #define PROCESS_DEP_ENABLE 0x00000001
40 #endif
41 #ifndef PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
42 #define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
43 #endif
44 #endif
45
46 #include "e-util/e-util-private.h"
47
48 gint
49 main (gint argc,
50 gchar **argv)
51 {
52 AlarmNotify *alarm_notify_service;
53 gint exit_status;
54 GError *error = NULL;
55 #ifdef G_OS_WIN32
56 gchar *path;
57
58 /* Reduce risks */
59 {
60 typedef BOOL (WINAPI *t_SetDllDirectoryA) (LPCSTR lpPathName);
61 t_SetDllDirectoryA p_SetDllDirectoryA;
62
63 p_SetDllDirectoryA = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetDllDirectoryA");
64 if (p_SetDllDirectoryA)
65 (*p_SetDllDirectoryA) ("");
66 }
67 #ifndef _WIN64
68 {
69 typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags);
70 t_SetProcessDEPPolicy p_SetProcessDEPPolicy;
71
72 p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy");
73 if (p_SetProcessDEPPolicy)
74 (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
75 }
76 #endif
77 #endif
78
79 bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
80 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
81 textdomain (GETTEXT_PACKAGE);
82
83 gtk_init (&argc, &argv);
84
85 e_gdbus_templates_init_main_thread ();
86
87 #ifdef G_OS_WIN32
88 path = g_build_path (";", _e_get_bindir (), g_getenv ("PATH"), NULL);
89
90 if (!g_setenv ("PATH", path, TRUE))
91 g_warning ("Could not set PATH for Evolution Alarm Notifier");
92 #endif
93
94 alarm_notify_service = alarm_notify_new (NULL, &error);
95
96 if (error != NULL) {
97 g_printerr ("%s\n", error->message);
98 g_error_free (error);
99 exit (EXIT_FAILURE);
100 }
101
102 g_application_register (G_APPLICATION (alarm_notify_service), NULL, &error);
103
104 if (error != NULL) {
105 g_printerr ("%s\n", error->message);
106 g_error_free (error);
107 g_object_unref (alarm_notify_service);
108 exit (EXIT_FAILURE);
109 }
110
111 if (g_application_get_is_remote (G_APPLICATION (alarm_notify_service))) {
112 g_object_unref (alarm_notify_service);
113 return 0;
114 }
115
116 exit_status = g_application_run (
117 G_APPLICATION (alarm_notify_service), argc, argv);
118
119 g_object_unref (alarm_notify_service);
120
121 return exit_status;
122 }