---- glib-2.32.4/gio/gcontenttype.c.orig 2012-07-14 22:33:18.000000000 +0200
-+++ glib-2.32.4/gio/gcontenttype.c 2012-07-24 16:48:52.400116342 +0200
-@@ -332,7 +332,7 @@
-
- /* our test suite and potentially other code used -1 in the past, which is
- * not documented and not allowed; guard against that */
-- g_return_val_if_fail (data_size != (gsize) -1, g_strdup (XDG_MIME_TYPE_UNKNOWN));
-+ g_return_val_if_fail (data_size != (gsize) -1, g_strdup ("*"));
-
- if (filename)
- {
---- glib-2.34.0/gio/gregistrysettingsbackend.c.orig 2012-08-19 16:39:53.000000000 +0200
-+++ glib-2.34.0/gio/gregistrysettingsbackend.c 2012-09-26 17:54:44.204962755 +0200
-@@ -233,7 +233,7 @@
- if (result_code == ERROR_KEY_DELETED)
- trace ("(%s)", win32_message);
- else
-- g_message (win32_message);
-+ g_message ("%s", win32_message);
- };
+--- glib-2.40.0/glib/grand.c.orig 2014-02-22 16:29:07.000000000 +0100
++++ glib-2.40.0/glib/grand.c 2014-03-25 18:45:39.693348981 +0100
+@@ -55,6 +55,7 @@
+ #endif
+ #ifdef G_OS_WIN32
++#include <windows.h>
+ #include <stdlib.h>
+ #endif
+--- glib-2.44.0/gio/gwin32networking.h.orig 2015-03-20 18:33:38.000000000 +0100
++++ glib-2.44.0/gio/gwin32networking.h 2015-03-23 21:03:15.924279829 +0100
+@@ -24,8 +24,9 @@
+ /* Check if more ANSI-compliant Winsock2 functions are provided */
+ /* For run-time compatibility with Windows XP, remove when XP support dropped */
+
+-typedef INT (WSAAPI *PFN_InetPton) (INT, PCTSTR, PVOID);
+-typedef PCTSTR (WSAAPI *PFN_InetNtop) (INT, PVOID, PTSTR, size_t);
++typedef ULONG NET_IFINDEX;
++typedef INT (WSAAPI *PFN_InetPton) (INT, LPCTSTR, PVOID);
++typedef LPCTSTR (WSAAPI *PFN_InetNtop) (INT, PVOID, PTSTR, size_t);
+ typedef NET_IFINDEX (WINAPI *PFN_IfNameToIndex) (PCSTR);
+
+ typedef struct _GWin32WinsockFuncs
+--- glib-2.46.0/glib/gstrfuncs.c.orig 2015-09-12 18:05:31.000000000 +0200
++++ glib-2.46.0/glib/gstrfuncs.c 2015-09-22 17:09:13.736714571 +0200
+@@ -1272,7 +1272,7 @@
+ gchar buf[1024];
+ GError *error = NULL;
+
+-#if defined(G_OS_WIN32)
++#if defined(G_OS_WIN32) && !defined(__MINGW32__)
+ strerror_s (buf, sizeof (buf), errnum);
+ msg = buf;
+ #elif defined(HAVE_STRERROR_R)
+--- glib-2.46.0/gio/gwin32appinfo.c.orig 2015-09-21 14:37:29.000000000 +0200
++++ glib-2.46.0/gio/gwin32appinfo.c 2015-09-22 17:34:28.039984356 +0200
+@@ -34,6 +34,11 @@
+ #include <gio/gwin32registrykey.h>
+
+ #include <windows.h>
++#include <wchar.h>
++
++#ifndef LOAD_LIBRARY_AS_IMAGE_RESOURCE
++#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x20
++#endif
+
+ /* We need to watch 8 places:
+ * 0) HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations
+--- glib-2.46.0/gio/gwin32registrykey.c.orig 2015-09-21 12:44:58.000000000 +0200
++++ glib-2.46.0/gio/gwin32registrykey.c 2015-09-22 18:50:25.926459740 +0200
+@@ -25,10 +25,21 @@
+ #pragma warning ( disable:4005 )
+ #endif
+ #include <windows.h>
++#ifdef __MINGW32__
++#include <ddk/ntstatus.h>
++#include <ddk/ntddk.h>
++#if !defined HKEY_PERFORMANCE_NLSTEXT
++#define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000060) )
++#endif
++#if ! defined HKEY_PERFORMANCE_TEXT
++#define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000050) )
++#endif
++#else
+ #include <ntstatus.h>
+ #include <winternl.h>
++#endif
+
+-#ifndef _WDMDDK_
++#if !defined(_WDMDDK_) && !defined(__WINDDK_H)
+ typedef enum _KEY_INFORMATION_CLASS {
+ KeyBasicInformation,
+ KeyNodeInformation,
+--- glib-2.46.1/glib/gwin32.c.orig 2015-10-14 15:04:10.000000000 +0200
++++ glib-2.46.1/glib/gwin32.c 2015-10-16 18:30:22.408973356 +0200
+@@ -59,6 +59,9 @@
+ #ifdef _MSC_VER
+ #pragma comment (lib, "ntoskrnl.lib")
+ #endif
++
++#else
++#include <ddk/ntddk.h>
+ #endif
+
+ #include "glib.h"