aboutsummaryrefslogtreecommitdiffstats
path: root/win/wm_hooks/wm_hooks.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win/wm_hooks/wm_hooks.cxx')
-rw-r--r--win/wm_hooks/wm_hooks.cxx38
1 files changed, 18 insertions, 20 deletions
diff --git a/win/wm_hooks/wm_hooks.cxx b/win/wm_hooks/wm_hooks.cxx
index 61328af8..50a981e8 100644
--- a/win/wm_hooks/wm_hooks.cxx
+++ b/win/wm_hooks/wm_hooks.cxx
@@ -25,6 +25,8 @@
#include <wm_hooks/wm_hooks.h>
#include <os/os.h>
+#define SHARED __attribute__((section ("shared"), shared))
+
UINT WM_HK_PingThread = RegisterWindowMessage(_T("RFB.WM_Hooks.PingThread"));
UINT WM_HK_WindowChanged = RegisterWindowMessage(_T("RFB.WM_Hooks.WindowChanged"));
@@ -86,20 +88,18 @@ BOOL WINAPI DllMain(HANDLE instance, ULONG reason, LPVOID reserved) {
// -=- Display update hooks
//
-#pragma data_seg(".WM_Hooks_Shared")
-DWORD hook_owner = 0;
-DWORD hook_target = 0;
-HHOOK hook_CallWndProc = 0;
-HHOOK hook_CallWndProcRet = 0;
-HHOOK hook_GetMessage = 0;
-HHOOK hook_DialogMessage = 0;
-BOOL enable_cursor_shape = FALSE;
-HCURSOR cursor = 0;
+DWORD hook_owner SHARED = 0;
+DWORD hook_target SHARED = 0;
+HHOOK hook_CallWndProc SHARED = 0;
+HHOOK hook_CallWndProcRet SHARED = 0;
+HHOOK hook_GetMessage SHARED = 0;
+HHOOK hook_DialogMessage SHARED = 0;
+BOOL enable_cursor_shape SHARED = FALSE;
+HCURSOR cursor SHARED = 0;
#ifdef _DEBUG
-UINT diagnostic_min=1;
-UINT diagnostic_max=0;
+UINT diagnostic_min SHARED =1;
+UINT diagnostic_max SHARED =0;
#endif
-#pragma data_seg()
#ifdef _DEBUG
DLLEXPORT void WM_Hooks_SetDiagnosticRange(UINT min, UINT max) {
@@ -374,14 +374,12 @@ BOOL WM_Hooks_Remove(DWORD owner) {
// -=- User input hooks
//
-#pragma data_seg(".WM_Hooks_Shared")
-HHOOK hook_keyboard = 0;
-HHOOK hook_pointer = 0;
-bool enable_real_ptr = true;
-bool enable_synth_ptr = true;
-bool enable_real_kbd = true;
-bool enable_synth_kbd = true;
-#pragma data_seg()
+HHOOK hook_keyboard SHARED = 0;
+HHOOK hook_pointer SHARED = 0;
+bool enable_real_ptr SHARED = true;
+bool enable_synth_ptr SHARED = true;
+bool enable_real_kbd SHARED = true;
+bool enable_synth_kbd SHARED = true;
#ifdef WH_KEYBOARD_LL
LRESULT CALLBACK HookKeyboardHook(int nCode, WPARAM wParam, LPARAM lParam) {