Closed
Description
Summary
when Globalunlock is used to unlock memory allocated with globalalloc an err is returned with a value of 0x00000000 whcih means it succeeded despite returning err rather than ok
Crate manifest
windows = { version = "0.61.1", features = ["Win32_System_DataExchange", "Win32_System_Memory"] }
Crate code
let mem = GlobalAlloc(GMEM_MOVEABLE, len)?;
let handle = GlobalLock(mem) as *mut u8;
copy_nonoverlapping(data.as_ptr(), handle, len);
let unlock = GlobalUnlock(mem);
if let Err(e) = unlock {
eprintln!("failed to unlock memory");
return Err(Box::new(io::Error::new(ErrorKind::Other, "failed to unlock mem")))
}