]> Pileus Git - ~andy/gtk/commitdiff
Fix broken function pointer declarations on windows
authorAlan McGovern <alan@xamarin.com>
Fri, 23 Nov 2012 20:38:34 +0000 (15:38 -0500)
committerMichael Natterer <mitch@gimp.org>
Thu, 29 Nov 2012 14:07:42 +0000 (15:07 +0100)
Both flashing a window and setting the window opacity were using
incorrect declarations for function pointers. They were missing the
WINAPI annotation as defined in windows.h. As a result, the stack
could be corrupted when these functions were invoked.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=689235
(cherry picked from commit 5637ef1f97ee46666c97707ed7f6bae459007163)

gdk/win32/gdkwindow-win32.c

index 92b88392f9be505a6739791ded8c57bda4b5e8be..5d1b1535e9a925e7ac21518dc43907f036b9b195 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "config.h"
 #include <stdlib.h>
+#include <windows.h>
 
 #include "gdk.h"
 #include "gdkwindowimpl.h"
@@ -1533,7 +1534,7 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window,
                             gboolean   urgent)
 {
   FLASHWINFO flashwinfo;
-  typedef BOOL (*PFN_FlashWindowEx) (FLASHWINFO*);
+  typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*);
   PFN_FlashWindowEx flashWindowEx = NULL;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
@@ -3264,7 +3265,7 @@ gdk_win32_window_set_opacity (GdkWindow *window,
                        gdouble    opacity)
 {
   LONG exstyle;
-  typedef BOOL (*PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
+  typedef BOOL (WINAPI *PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
   PFN_SetLayeredWindowAttributes setLayeredWindowAttributes = NULL;
 
   g_return_if_fail (GDK_IS_WINDOW (window));