Using Threadpool in managed code run from a Runtime started by nethost #123093
-
|
Hello guys, I am writing a scripting system for an Unreal Engine 3 game. My native host is loaded into the game using DLL injection. Then, I use Here's a link to my native host (~100 lines without boilerplate code) and here's a link to the function that it's running. I am using a modified version of the tutorial host. I also tried switching to the newer independent I wanted to ask if this is a known issue or if I have something misconfigured. Are there any workarounds for this problem that I haven't tried yet? Thanks in advance. Samuil1337 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You are calling Perhaps on
|
Beta Was this translation helpful? Give feedback.
You are calling
LoadLibraryfromDllMain, some that is explicitly not allowed. See Dynamic-Link Library Best Practices. Using managed code is also on the list.Perhaps on
DLL_PROCESS_ATTACHuseCreateThreadto call yourload_dllfunction, rather than calling it directly?hostfxr_closepotentially takes a lock and uses memory management functions ( see here ). Those are also not allowed inDllMain. And the host handle is not thread safe ( see here ). So I'm not sure what is the right way to clean that up.