mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
be8394f0bd
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1920 21ef857c-d57f-4fe0-8362-d861dc6d29cd
59 lines
1.3 KiB
C#
59 lines
1.3 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Security;
|
|
|
|
namespace TaskbarLib
|
|
{
|
|
internal class IconHandle : SafeHandle
|
|
{
|
|
internal IconHandle()
|
|
: this(IntPtr.Zero)
|
|
{
|
|
}
|
|
|
|
[SecurityCritical, SecurityTreatAsSafe]
|
|
internal IconHandle(IntPtr ptr)
|
|
: base(ptr, true)
|
|
{
|
|
}
|
|
|
|
[SecurityTreatAsSafe, SecurityCritical]
|
|
internal IconHandle(IntPtr ptr, bool ownsHandle)
|
|
: base(ptr, ownsHandle)
|
|
{
|
|
}
|
|
|
|
public override bool IsInvalid
|
|
{
|
|
[SecurityTreatAsSafe, SecurityCritical]
|
|
get
|
|
{
|
|
return this.handle == IntPtr.Zero;
|
|
}
|
|
}
|
|
|
|
public HandleRef MakeHandleRef(object wrapper)
|
|
{
|
|
return new HandleRef(wrapper, this.handle);
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
var other = obj as IconHandle;
|
|
|
|
return other != null && other.handle.Equals(this.handle);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return this.handle.ToInt32();
|
|
}
|
|
|
|
[SecurityCritical]
|
|
protected override bool ReleaseHandle()
|
|
{
|
|
return true;// Win32.DestroyIcon(this.handle);
|
|
}
|
|
}
|
|
|
|
} |