[glib: 3/5] gmodule: Don't try to use toolhelp for symbol searching on UWP



commit 2e2558b3139aac8912b7c01476b6cf0f5df57496
Author: Nirbheek Chauhan <nirbheek centricular com>
Date:   Wed Aug 14 11:40:07 2019 +0530

    gmodule: Don't try to use toolhelp for symbol searching on UWP
    
    This is not allowed under UWP.

 gmodule/gmodule-win32.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gmodule/gmodule-win32.c b/gmodule/gmodule-win32.c
index 3cddb614a..795dc0938 100644
--- a/gmodule/gmodule-win32.c
+++ b/gmodule/gmodule-win32.c
@@ -127,8 +127,11 @@ find_in_any_module_using_toolhelp (const gchar *symbol_name)
   HANDLE snapshot; 
   MODULEENTRY32 me32;
 
-  gpointer p;
+  gpointer p = NULL;
 
+  /* Under UWP, Module32Next and Module32First are not available since we're
+   * not allowed to search in the address space of arbitrary loaded DLLs */
+#if !defined(G_WINAPI_ONLY_APP)
   if ((snapshot = CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, 0)) == (HANDLE) -1)
     return NULL;
 
@@ -143,6 +146,7 @@ find_in_any_module_using_toolhelp (const gchar *symbol_name)
     }
 
   CloseHandle (snapshot);
+#endif
 
   return p;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]