From ee1985386700288af1a8b1789dcad0d7d9c97393 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 16 Apr 2011 23:28:45 +0100 Subject: hw/xwin: Link directly to TrackMouseEvent() TrackMouseEvent has existed in user32 since at least NT4, so don't bother with jumping through all the ancient compatibility hoops of finding if _TrackMouseEvent() exists in comctl32 so it can check if TrackMouseEvent() exists in user32 to see if it needs to emulate it... Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 35 ----------------------------------- hw/xwin/win.h | 1 - hw/xwin/winglobals.c | 7 ------- hw/xwin/winmultiwindowwndproc.c | 4 ++-- hw/xwin/winwin32rootlesswndproc.c | 4 ++-- hw/xwin/winwndproc.c | 4 ++-- 6 files changed, 6 insertions(+), 49 deletions(-) diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 4fe5053b3..67961b721 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -70,12 +70,6 @@ extern HWND g_hwndClipboard; extern Bool g_fClipboard; #endif - -/* - module handle for dynamically loaded comctl32 library -*/ -static HMODULE g_hmodCommonControls = NULL; - /* * Function prototypes */ @@ -235,14 +229,6 @@ ddxGiveUp (enum ExitCode error) * we are guaranteed to not need the DirectDraw functions. */ winReleaseDDProcAddresses(); - - /* Unload our TrackMouseEvent function pointer */ - if (g_hmodCommonControls != NULL) - { - FreeLibrary (g_hmodCommonControls); - g_hmodCommonControls = NULL; - g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - } /* Free concatenated command line */ free(g_pszCommandLine); @@ -979,27 +965,6 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) /* Detect supported engines */ winDetectSupportedEngines (); - /* Load common controls library */ - g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0); - - /* Load TrackMouseEvent function pointer */ - g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls, - "_TrackMouseEvent"); - if (g_fpTrackMouseEvent == NULL) - { - winErrorFVerb (1, "InitOutput - Could not get pointer to function\n" - "\t_TrackMouseEvent in comctl32.dll. Try installing\n" - "\tInternet Explorer 3.0 or greater if you have not\n" - "\talready.\n"); - - /* Free the library since we won't need it */ - FreeLibrary (g_hmodCommonControls); - g_hmodCommonControls = NULL; - - /* Set function pointer to point to no operation function */ - g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - } - /* Store the instance handle */ g_hInstance = GetModuleHandle (NULL); diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 445bcab48..e2e946fb5 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -673,7 +673,6 @@ extern DeviceIntPtr g_pwinKeyboard; extern FARPROC g_fpDirectDrawCreate; extern FARPROC g_fpDirectDrawCreateClipper; -extern FARPROC g_fpTrackMouseEvent; /* diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index 2909f371b..631f12e21 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -78,13 +78,6 @@ Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = FALSE; -/* - * Global variables for dynamically loaded libraries and - * their function pointers - */ - -FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - #ifdef XWIN_CLIPBOARD /* diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index fb1938b3a..3d23e9746 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -549,8 +549,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, tme.hwndTrack = hwnd; /* Call the tracking function */ - if (!(*g_fpTrackMouseEvent) (&tme)) - ErrorF ("winTopLevelWindowProc - _TrackMouseEvent failed\n"); + if (!TrackMouseEvent(&tme)) + ErrorF ("winTopLevelWindowProc - TrackMouseEvent failed\n"); /* Flag that we are tracking now */ s_fTracking = TRUE; diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c index 21506df15..c60a76cba 100644 --- a/hw/xwin/winwin32rootlesswndproc.c +++ b/hw/xwin/winwin32rootlesswndproc.c @@ -547,8 +547,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, tme.hwndTrack = hwnd; /* Call the tracking function */ - if (!(*g_fpTrackMouseEvent) (&tme)) - ErrorF ("winMWExtWMWindowProc - _TrackMouseEvent failed\n"); + if (!TrackMouseEvent(&tme)) + ErrorF ("winMWExtWMWindowProc - TrackMouseEvent failed\n"); /* Flag that we are tracking now */ s_fTracking = TRUE; diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index bccd6f9f2..a89857a14 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -776,8 +776,8 @@ winWindowProc (HWND hwnd, UINT message, tme.hwndTrack = hwnd; /* Call the tracking function */ - if (!(*g_fpTrackMouseEvent) (&tme)) - ErrorF ("winWindowProc - _TrackMouseEvent failed\n"); + if (!TrackMouseEvent(&tme)) + ErrorF ("winWindowProc - TrackMouseEvent failed\n"); /* Flag that we are tracking now */ s_fTracking = TRUE; -- cgit v1.2.3