public bool Init(string HidDevicePath)
{
SECURITY_ATTRIBUTES structure = new SECURITY_ATTRIBUTES();
structure.lpSecurityDescriptor = 0;
structure.bInheritHandle = Convert.ToInt32(true);
structure.nLength = Marshal.SizeOf(structure);
_hidFileHandle = CreateFile(HidDevicePath, 0xc0000000, 3, ref structure, 3, 0, 0);
if (_hidFileHandle == -1)
{
return false;
}
_workerThread = new Thread(Worker);
_workerThread.Start();
IsAlive = true;
return true;
}