IliumVR / SimplerHidWrite

An updated version of SimpleHidWrite in C#/WinForms
MIT License
9 stars 9 forks source link

It is deny access. #2

Open quanfeining opened 4 years ago

quanfeining commented 4 years ago

Hello@Robmaister

When I attempt to run your latest commit on your Fork for SimplerHidWrite,I get this mistake:

if (!Kernel32.File.ReadAsync(reference, gch.AddrOfPinnedObject(), inBuffer.Length, ref bytesRead, fileOverlapped)) { if (Marshal.GetLastWin32Error() != 997)// ERROR_IO_PENDING throw new Win32Exception();

                if (!fileEvent.WaitOne(timeout))
                {
                    Kernel32.File.CancelIo(reference);
                    //fileEvent.Reset();
                    gch.Free();
                    return false;
                }

} Kernel32.File.ReadAsync(reference, gch.AddrOfPinnedObject(), inBuffer.Length, ref bytesRead, fileOverlapped) this line wiil get error, "Win32Exception() 0x80004005" ,is deny access.

this is :IliumVR.Bindings.Win32.Hid/HidDevice.cs

I am using Visual Studio 2017 on Windows 10 1903.