The handle that I create via CreateFile is valid
Here's where I create the handle (returns a valid handle for my
device)
hDevice = CreateFile(
devDetailData->DevicePath,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL);
I then create an event and an OVERLAPPED structure:
HANDLE hEvent = CreateEvent(
NULL,
TRUE,
FALSE,
NULL);
OVERLAPPED gOverLapped;
gOverLapped.Offset = 0;
gOverLapped.OffsetHigh = 0;
gOverLapped.hEvent = hEvent;
I then init some variables for the ReadFile() function and call it:
CHAR pBuf[3];
pBuf[0] = 0;
DWORD nBytesRead;
BOOL bResult;
bResult = ReadFile(hDevice, pBuf, 3, &nBytesRead, &gOverLapped);
The result I receive via GetLastError() is "The parameter is
incorrect."
Any help would be GREATLY appreciated.
> I am trying to call ReadFile() on a handle for a USB storage device,
> however, ReadFile() returns false everytime with the error code:
> "Parameter is Incorrect."
What makes you think you should be able to do this? What are you
trying to do?
i'm trying to establish a connection with my usb driver so that i can
call ioctl's on it. all USB device interfacing examples state that
ReadFile() should be called upon successful creation of the handle.
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
<davidm...@gmail.com> wrote in message
news:bda50d88-f31b-49d6...@e39g2000hsf.googlegroups.com...
<davidm...@gmail.com> wrote in message
news:bda50d88-f31b-49d6...@e39g2000hsf.googlegroups.com...