dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.12k stars 222 forks source link

Kernel32.ReadProcessMemory should use SafeObjectHandle #487

Closed qmfrederik closed 4 years ago

qmfrederik commented 4 years ago

Kernel32.OpenProcess returns a SafeObjectHandle, so it seems logic for Kernel32.ReadProcessMemory to accept a SafeObjectHandle, too.

AArnott commented 4 years ago

Agreed. Let's add an overload for this and add [Obsolete] on the existing one to spread out the breaking change.