Files
mirror-processhacker/trunk/ProcessHacker.Native/Objects/DeviceHandle.cs
T
wj32 bbdf6b3f49 added ability to unload drivers
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1613 21ef857c-d57f-4fe0-8362-d861dc6d29cd
2009-07-20 09:45:43 +00:00

22 lines
571 B
C#

using ProcessHacker.Native.Api;
namespace ProcessHacker.Native.Objects
{
public class DeviceHandle : NativeHandle
{
public DeviceHandle(string name, ObjectFlags objectFlags, DirectoryHandle rootDirectory)
{
ObjectAttributes oa = new ObjectAttributes(name, objectFlags, rootDirectory);
try
{
this.Handle = KProcessHacker.Instance.KphOpenDevice(oa).ToIntPtr();
}
finally
{
oa.Dispose();
}
}
}
}