On Mon, 30 Oct 2023, Ozkan Sezer wrote:
On 10/30/23, Ozkan Sezer <[email protected]> wrote:
On 10/30/23, Jeremy Drake via Mingw-w64-public
<[email protected]> wrote:
On Tue, 24 Oct 2023, Ozkan Sezer wrote:
LoadLibrary needs cleaning after, and we do link to kernel32.dll anyway.
How does this play out with winstore apps using winstorecompat? It seems
that GetModuleHandle in winstorecompat always returns NULL, while
LoadLibrary ends up calling LoadPackagedLibrary. I have never actually
written such apps, so I don't know what LoadPackagedLibrary would return
for kernel32.dll.
I was actually originally thinking an implementation of GetProcAddress
was
provided to always return NULL, and that adding "support" for win 98
might
have had an unintended consequence of forcing store apps to always use
the
fallback case. Perhaps that is the case now with GetModuleHandle.
I have no idea about store apps, sorry.
However, maybe something like the following can be done. (Not even
compile-tested, and don't know whether it's correct - just showing
the idea. Someone more familiar with winstrore should mess with it
And also note that clock.c also has a GetModuleHandle use which is
not mine..)
diff --git a/mingw-w64-libraries/winpthreads/src/misc.c
b/mingw-w64-libraries/winpthreads/src/misc.c
index 79c01f2..7db5e91 100644
--- a/mingw-w64-libraries/winpthreads/src/misc.c
+++ b/mingw-w64-libraries/winpthreads/src/misc.c
@@ -22,2 +22,3 @@
+#include <winapifamily.h>
#include "pthread.h"
@@ -30,3 +31,7 @@
{
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ GetTickCount64FuncPtr = GetTickCount64;
+#else
GetTickCount64FuncPtr = (__typeof__(GetTickCount64FuncPtr))
GetProcAddress(GetModuleHandle("kernel32.dll"), "GetTickCount64");
+#endif
}
Something like that would work, yes, but the idea with the winstorecompat
library is that one can use a regular mingw-w64 toolchain without needing
to rebuild all the libraries that are shipped along with the toolchain
(e.g. winpthreads).
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public