Rm drop impl for LibraryHandle

As unmounting dynlib might cause UB

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2024-08-03 13:53:10 +10:00 committed by GitHub
parent 1add356939
commit a026dc2a4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
use std::{mem, ptr}; use std::{mem, ptr};
use windows_sys::Win32::{ use windows_sys::Win32::{
Foundation::{FreeLibrary, HMODULE, S_OK}, Foundation::{HMODULE, S_OK},
System::{ System::{
LibraryLoader::{GetProcAddress, LoadLibraryA}, LibraryLoader::{GetProcAddress, LoadLibraryA},
SystemInformation::{ SystemInformation::{
@ -33,12 +33,6 @@ impl LibraryHandle {
} }
} }
impl Drop for LibraryHandle {
fn drop(&mut self) {
unsafe { FreeLibrary(self.0) };
}
}
type GetMachineTypeAttributesFuncType = type GetMachineTypeAttributesFuncType =
unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32; unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32;
const _: () = { const _: () = {