You do not need to write the code in assembly, there are some wrappers given
in DDK. Just study that and then u can directly call them by calling
functions written in “C”.
So just forget assembly.
If u feel further any problem, feel free to ask.
Nigam
-----Original Message-----
From: jayadev m n [mailto:xxxxx@yahoo.com]
Sent: Tuesday, August 21, 2001 3:35 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Using 98 VCOMM services in a .sys driver…
Hi,
I’m not sure i am right in this matter, actually in
one of the application i tried to issue the read
request ( in the context of the IRP_MJ_READ irp
handler) but it used to fail or occasionally have a
dead lock and the machine used to freeze. Later i
moved this code to
a seperate thread (ReaderThread) in driver and things
started to work.
I think this is something to with the context at which
it called (I may
be totally wrong). All I do now is that i poll the
COMPORT at say every
10ms and put the data read into a shared fifo, My
IRP_MJ_READ will read
the data from the Fifo and get back.
Also as Mathias Ellinger he suggested,you should use
the set the COM
timeouts and then start the read. The timeouts exactly
depends on your
application requirements.
This is my piece of code used.
DWORD wVCOMM_ReadComm(HPORT lhPort, char *RxBuffer,
DWORD cchRxRequested, DWORD *cchReceived)
{
DWORD vcRetval;
__asm mov ebx,cchReceived
__asm push ebx
__asm mov eax,cchRxRequested
__asm push eax
__asm mov ebx,RxBuffer
__asm push ebx
__asm mov eax,lhPort
__asm push eax
__asm int 0x20
__asm _emit 0x13
__asm _emit 0x00
__asm _emit 0x2b
__asm _emit 0x00
__asm add sp,0x10
__asm mov vcRetval,eax
return(vcRetval);
}
Cheers,
Jay
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com