Skip to content

Commit d4ad4e5

Browse files
committed
fix: avoid closing a module base address
1 parent 13a6113 commit d4ad4e5

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎StArray.ModManager/RuntimeAbstractions/RuntimeManager.cs‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ private static extern uint GetModuleFileNameW(IntPtr hModule,
148148
internal const int RtldNoLoad = 0x0004;
149149

150150
private static bool IsUnixLibraryLoaded(string filename)
151-
=> ProbeUnixLibrary(
152-
filename,
153-
(name, flags) => DL.Open(
154-
name, (DL.RTLDFlags)(flags)), // ProbeUnixLibrary 只传 NOW|NOLOAD,直接透传
155-
handle => _ = DL.Close(handle));
151+
=> DL.GetBaseAddress(filename) != IntPtr.Zero;
156152

157153
internal static bool ProbeUnixLibrary(
158154
string filename,

0 commit comments

Comments
 (0)