ReadFile buffer in NT/XP
ReadFile buffer in NT/XP
(OP)
Hi all,
I wrote an assembly language program four years back in Win 95/98.It also works on ME.But now my client wants it NT/XP compatible.Everything works fine except reading the com port.My problem is this-no matter how many bytes I tell the function ReadFile to read,it reads only 258 bytes(the same function reads faithfully in Win98).Not only that it filters few binary characters like 0dH(i.e.,LF,CR) How can I read correctly and more than this in NT?Comm timeouts are zero.
Typical port reading-
mov dword ptr[ol.hEvent],0
mov dword ptrytes_To_Read],1024
mov dword ptr[ol.Offset],0
mov dword ptr[ol.OffsetHigh],0
push offset ol
push offset Bytes_Read
push [Bytes_To_Read]
push offset ReadBuffer
push [hCom]
call ReadFile
Cmp eax,0
jne Noerror
Call GetLastError
;->here I put in Microsoft suggested GetOverlapped result
;to wait till port reading is complete.
Any suggetions as what is missing??
Thanks in advance.
I wrote an assembly language program four years back in Win 95/98.It also works on ME.But now my client wants it NT/XP compatible.Everything works fine except reading the com port.My problem is this-no matter how many bytes I tell the function ReadFile to read,it reads only 258 bytes(the same function reads faithfully in Win98).Not only that it filters few binary characters like 0dH(i.e.,LF,CR) How can I read correctly and more than this in NT?Comm timeouts are zero.
Typical port reading-
mov dword ptr[ol.hEvent],0
mov dword ptrytes_To_Read],1024
mov dword ptr[ol.Offset],0
mov dword ptr[ol.OffsetHigh],0
push offset ol
push offset Bytes_Read
push [Bytes_To_Read]
push offset ReadBuffer
push [hCom]
call ReadFile
Cmp eax,0
jne Noerror
Call GetLastError
;->here I put in Microsoft suggested GetOverlapped result
;to wait till port reading is complete.
Any suggetions as what is missing??
Thanks in advance.





RE: ReadFile buffer in NT/XP
RE: ReadFile buffer in NT/XP
Thanks for the reply.To give a slight insight into the COM port access ,I am using Win32 API which in real uses the same Com port driver OS places in between. I got around the problem ,for the time being by setting comm timeouts to null and reading com port in multiples.I could change any damn aspect of com port but could not extend the buffer size.
Thanks again and best regards
Kamal