Undo of some cleanup which causes issues,

This commit is contained in:
Robin 2016-04-26 23:13:37 +02:00
commit 5c04af1684
2 changed files with 63 additions and 1 deletions

View file

@ -359,6 +359,16 @@ namespace GreenshotPlugin.UnmanagedHelpers {
/// A SafeHandle class implementation for the hIcon
/// </summary>
public class SafeIconHandle : SafeHandleZeroOrMinusOneIsInvalid {
/// <summary>
/// Needed for marshalling return values
/// </summary>
[SecurityCritical]
public SafeIconHandle() : base(true)
{
}
public SafeIconHandle(IntPtr hIcon) : base(true) {
SetHandle(hIcon);
}
@ -380,6 +390,13 @@ namespace GreenshotPlugin.UnmanagedHelpers {
private readonly IntPtr _hWnd;
/// <summary>
/// Needed for marshalling return values
/// </summary>
public SafeWindowDCHandle() : base(true)
{
}
[SecurityCritical]
public SafeWindowDCHandle(IntPtr hWnd, IntPtr preexistingHandle) : base(true) {
_hWnd = hWnd;