G
Guest
Hello NG
I’m developing software for my hardware which is connected via USB to my computer, I already have written the necessary firmware and a mini driver (by Windws2000 DDK) which both works
The Problem
I want to define communication time outs for non-overlapped read and write operations using GetCommTimeouts and SetCommTimeouts but they return with ErrorCode 87 (Invalid Parameters). But I deeply believe that my parameters are correct. I use the same handle that I pass to those two functions to read from and write to my device with no problem
Part of my code is
COMMTIMEOUTS tOuts
HANDLE h = NULL
h = CreateFile(CompleteUsbName, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING,0, NULL)
if(h == INVALID_HANDLE_VALUE
{
//Debug
if(!GetCommTimeouts(h,&tOuts)
//Debug, GetLastError,â€
if(!SetCommTimeouts(h, &tOuts)
//Debug, GetLastError,â€
I really appreciate any help
Regards, Ebrahi
I’m developing software for my hardware which is connected via USB to my computer, I already have written the necessary firmware and a mini driver (by Windws2000 DDK) which both works
The Problem
I want to define communication time outs for non-overlapped read and write operations using GetCommTimeouts and SetCommTimeouts but they return with ErrorCode 87 (Invalid Parameters). But I deeply believe that my parameters are correct. I use the same handle that I pass to those two functions to read from and write to my device with no problem
Part of my code is
COMMTIMEOUTS tOuts
HANDLE h = NULL
h = CreateFile(CompleteUsbName, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING,0, NULL)
if(h == INVALID_HANDLE_VALUE
{
//Debug
if(!GetCommTimeouts(h,&tOuts)
//Debug, GetLastError,â€
if(!SetCommTimeouts(h, &tOuts)
//Debug, GetLastError,â€
I really appreciate any help
Regards, Ebrahi