aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-10-06 06:43:30 +0100
committerJoão Valverde <j@v6e.pt>2022-10-11 14:25:04 +0100
commita19834b98cda6d31bc31534b8cd497d055645439 (patch)
tree7de3e05fa14042c9d014bd353c5ed33460c8440d /include
parent44d1cc6d4a8ac93c235356554d505759ea1d6aba (diff)
Windows: Store "gui.console_open" in the Windows registry
This removes the last dependency of the logging subsystem on the preferences module. The latter is started much later than the former and this is an issue. The Windows-only preference "gui.console_open" is stored in the registry as HKEY_LOCAL_USER\Software\Wireshark\ConsoleOpen. The semantics are exactly the same. The preference is read by the logging subsystem for initialization and then again by the preferences (read/write) so the user can configure it as before. The code to store the preference also in the preferences file was kept, for backward compatibility and because it is not incompatible with using the Registry concurrently. The elimination of the prefs dependency also allows moving the Windows console logic to wsutil and add the functionality to wslog directly, thereby eliminating the superfluous Wireshark/Logray custom log handler. To be able to read the ws_log_console_open global variable from libwireshark it becomes necessary to add a new export macro symbol called WSUTIL_EXPORT.
Diffstat (limited to 'include')
-rw-r--r--include/ws_symbol_export.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/ws_symbol_export.h b/include/ws_symbol_export.h
index f4de27a404..a7b197719d 100644
--- a/include/ws_symbol_export.h
+++ b/include/ws_symbol_export.h
@@ -186,6 +186,22 @@
*/
#define WS_DLL_PUBLIC WS_DLL_PUBLIC_DEF extern
+/*
+ * This is necessary to export symbols from wsutil to another DLL
+ * (not an executable) using MSVC.
+ */
+#ifdef _MSC_VER
+# ifdef BUILD_WSUTIL
+# define WSUTIL_EXPORT __declspec(dllexport) extern
+# else
+# define WSUTIL_EXPORT __declspec(dllimport) extern
+# endif
+#else /* _MSC_VER */
+# define WSUTIL_EXPORT WS_DLL_PUBLIC
+#endif /* _MSC_VER */
+
+
+
#endif /* SYMBOL_EXPORT_H */
/*