usbeject icon indicating copy to clipboard operation
usbeject copied to clipboard

"Additional information: The supplied user buffer is not valid for the requested operation"

Open MrChriZ opened this issue 9 years ago • 2 comments

When attempting to use this on Windows 10 64 bit I get an exception:

System.ComponentModel.Win32Exception occurred ErrorCode=-2147467259 HResult=-2147467259 Message=The supplied user buffer is not valid for the requested operation NativeErrorCode=1784 Source=UsbEject StackTrace: at UsbEject.Library.DeviceClass.get_Devices() in usbeject-master\DeviceClass.cs:line 89 InnerException:

MrChriZ avatar Nov 25 '15 15:11 MrChriZ

I believe this stackoverflow question maybe related: http://stackoverflow.com/questions/30981181/c-sharp-usb-driver-from-c-setupdigetdeviceinterfacedetail

MrChriZ avatar Nov 25 '15 15:11 MrChriZ

It also not working on Win 32 bit using AnyCpu build. The message is: The supplied user buffer is not valid for the requested operation

I have uncommented few lines from DeviceClass, that been commented in last commit and it starts work using x86 build.

I think, that the problem is in 120 line of DeviceClass.cs:

var strPtr = new IntPtr(buffer.ToInt64() + 4);

kami4ka avatar Mar 07 '18 16:03 kami4ka