

InputLength = device_capabilities.InputReportByteLength HidP_GetCaps(device_data, out device_capabilities) HidCaps device_capabilities // Struct to contain inputlength etc. Throw new HIDException("Unable to get Preparsed data from device") If (!HidD_GetPreparsedData(dev_Handle, out device_data)) IntPtr dev_Handle = CreateFile(devPath, FileAccess.Read | FileAccess.Write, FileShare.Read | FileShare.Write, IntPtr.Zero, FileMode.Open, FILE_FLAG_OVERLAPPED, IntPtr.Zero) // Gives a "Valid" pointer If (devPath.Contains(PID_WIIMOTE)) // ADD OTHER PID (IF EVER FOUND) How can this handle be invalid here if I can GetCaps? Marshal32.GetLastWinError() is also returning 0.

However, when I try to open a FileStream on the handle, it errors with "Invalid Handle". is returned, and is the size that I'm expecting. When I call CreateFile() (from kernel32) a "valid" pointer is returned, and I can even get the Wiimote's capabilities through HidD_GetPreparsedData and HidP_GetCaps. I'm trying to connect to a Wiimote in Unit圓D through HID.
