1- From 4a4ba9ce9f666a66d027d84a26bb49bd6f92205a Mon Sep 17 00:00:00 2001
1+ From 6944869021af1f4f5585d7e54aaf0e8d971d0afd Mon Sep 17 00:00:00 2001
22From: Alwin Esch <alwin.esch@web.de>
33Date: Thu, 22 Aug 2019 19:30:12 +0100
44Subject: [PATCH] [win10] fixed uwp build
55
66---
7- src/dlfcn.c | 43 ++++++++++++++++++++++++++++++++++++++-----
8- 1 file changed, 38 insertions(+), 5 deletions(-)
7+ src/dlfcn.c | 47 +++++++++++++++++++++++++++++++++++++++++- -----
8+ 1 file changed, 41 insertions(+), 6 deletions(-)
99
1010diff --git a/src/dlfcn.c b/src/dlfcn.c
11- index cb9f9bb..74cac34 100644
11+ index cb9f9bb..ce43ae7 100644
1212--- a/src/dlfcn.c
1313+++ b/src/dlfcn.c
1414@@ -24,6 +24,7 @@
@@ -65,7 +65,7 @@ index cb9f9bb..74cac34 100644
6565 }
6666 else
6767 {
68- @@ -415,8 +424,25 @@ void *dlopen( const char *file, int mode )
68+ @@ -415,16 +424,35 @@ void *dlopen( const char *file, int mode )
6969 * to UNIX's search paths (start with system folders instead of current
7070 * folder).
7171 */
@@ -92,7 +92,17 @@ index cb9f9bb..74cac34 100644
9292 if( !hModule )
9393 {
9494 save_err_str( lpFileName, GetLastError( ) );
95- @@ -453,7 +479,9 @@ void *dlopen( const char *file, int mode )
95+ }
96+ else
97+ {
98+ + #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
99+ if( MyEnumProcessModules( hCurrentProc, NULL, 0, &dwProcModsAfter ) == 0 )
100+ dwProcModsAfter = 0;
101+ + #endif
102+
103+ /* If the object was loaded with RTLD_LOCAL, add it to list of local
104+ * objects, so that its symbols cannot be retrieved even if the handle for
105+ @@ -453,7 +481,9 @@ void *dlopen( const char *file, int mode )
96106 }
97107
98108 /* Return to previous state of the error-mode bit flags. */
@@ -102,7 +112,7 @@ index cb9f9bb..74cac34 100644
102112
103113 return (void *) hModule;
104114 }
105- @@ -488,13 +516 ,15 @@ void *dlsym( void *handle, const char *name )
115+ @@ -488,13 +518 ,15 @@ void *dlsym( void *handle, const char *name )
106116 {
107117 FARPROC symbol;
108118 HMODULE hCaller;
@@ -120,23 +130,27 @@ index cb9f9bb..74cac34 100644
120130 hModule = GetModuleHandle( NULL );
121131 dwMessageId = 0;
122132
123- @@ -525,6 +555 ,7 @@ void *dlsym( void *handle, const char *name )
133+ @@ -525,6 +557 ,7 @@ void *dlsym( void *handle, const char *name )
124134 goto end;
125135 }
126136 }
127137+ #endif
128138
129139 if( handle != RTLD_NEXT )
130140 {
131- @@ -538,6 +569,7 @@ void *dlsym( void *handle, const char *name )
141+ @@ -538,9 +571,10 @@ void *dlsym( void *handle, const char *name )
132142 * in all globally loaded objects.
133143 */
134144
135145+ #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
136146 if( hModule == handle || handle == RTLD_NEXT )
137147 {
138- HANDLE hCurrentProc;
139- @@ -588,6 +620,7 @@ void *dlsym( void *handle, const char *name )
148+ - HANDLE hCurrentProc;
149+ + HANDLE hCurrentProc = 0;
150+ HMODULE *modules;
151+ DWORD cbNeeded;
152+ DWORD dwSize;
153+ @@ -588,6 +622,7 @@ void *dlsym( void *handle, const char *name )
140154 }
141155 }
142156 }
@@ -145,5 +159,5 @@ index cb9f9bb..74cac34 100644
145159 end:
146160 if( symbol == NULL )
147161- -
148- 2.47.1.windows.1
162+ 2.53.0
149163
0 commit comments