diff --git a/src/runtime/Native/LibraryLoader.cs b/src/runtime/Native/LibraryLoader.cs index 6d67bea61..05f960481 100644 --- a/src/runtime/Native/LibraryLoader.cs +++ b/src/runtime/Native/LibraryLoader.cs @@ -137,17 +137,17 @@ public IntPtr GetFunction(IntPtr hModule, string procedureName) static IntPtr[] GetAllModules() { - var self = Process.GetCurrentProcess().Handle; + using var self = Process.GetCurrentProcess(); uint bytes = 0; var result = new IntPtr[0]; - if (!EnumProcessModules(self, result, bytes, out var needsBytes)) + if (!EnumProcessModules(self.Handle, result, bytes, out var needsBytes)) throw new Win32Exception(); while (bytes < needsBytes) { bytes = needsBytes; result = new IntPtr[bytes / IntPtr.Size]; - if (!EnumProcessModules(self, result, bytes, out needsBytes)) + if (!EnumProcessModules(self.Handle, result, bytes, out needsBytes)) throw new Win32Exception(); } return result.Take((int)(needsBytes / IntPtr.Size)).ToArray();
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: