I am attempting to connect to a USB GPS device. I can successfully connect to the device if I manually create a file via CreateFile WinApi (using the path specified in Devi
Congratulations, it is working. You'll get a Unicode string, it's twice as long. And a FALSE return is correct. You just need to call Marshal.GetLastWin32Error() and verify that you got ERROR_INSUFFICIENT_BUFFER. Your C code is broken, probably because you forgot to initialize theBytesReturned to zero.