Using 98 VCOMM services in a .sys driver..

Hi All,
I have built a driver on W2K which uses the services of the native serial
port driver. I have to modify this driver to work on win 98 and use the
native VCOMM services. I am unable to link the VCOMM services while
building a .sys driver.

My question is can I build a .sys driver for win 98 which use the VCOMM
services? If yes, how? Its ok with me if I have a separate binary than the
2k one.

Is it necessary that I have to opt for a .vxd to use VCOMM or is there any
work around? Pointers to any resource will be more than helpful.

Thanks in adv.

Regards,
Chakri


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

The VCOMM services only exist on Win9x therefore (as far as I know) you
will need build a separate VxD. If you use Numega’s SoftICE then VToolsD
will give you easy access to all of the VCOMM functions. If you don’t use
VToolsD or another company’s wrapper tools then it is a pain in the butt
because you have to make assembler calls. See the Win95 DDK for more
info.

Hope this gives you a few ideas.

  • Chris

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

Yes, You can avail the VCOMM services with in a sys
driver for a windows 98 machine. The approach is quite
indirect, it involves the usage of INT 20 with VCOMM
code 0x2B.

refer:
http://lrs.fmi.uni-passau.de/support/doc/interrupt-57/RB-2436.HTM
for more information.

This sample will just illustrate how to use this. I
use this to open a comport say COM1 in the Wdm driver

PortName = “COM1”;

int OpenComPort(char *PortName)
{
DWORD vcRetval;
__asm mov eax,-1
__asm push eax
__asm mov ebx,PortName
__asm push ebx
__asm int 0x20
__asm _emit 0x04
__asm _emit 0x00
__asm _emit 0x2b
__asm _emit 0x00
__asm add esp,0x08
__asm mov vcRetval,eax
return vcRetval;
}

int CloseComm(HPORT lhPort)
{
DWORD vcRetval;

__asm mov eax,lhPort
__asm push eax
__asm int 0x20
__asm _emit 0x09
__asm _emit 0x00
__asm _emit 0x2b
__asm _emit 0x00
__asm add esp,0x04
__asm mov vcRetval,eax

return(vcRetval);
}

You can now use this function to open the port, the
return value is the HANDLE to the port. You need to
write such wrappers to all other functions

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: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks Jaydev, that will be more than handy for my work…


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

Hello,

Here exist a second way from MS.

http://www.microsoft.com/hwdev/modem/softmodem.htm

You install your driver as normal PnP driver. A upper layer
filter driver is ccport.sys from MS und the VCOMM driver
is wdmmdmld.vxd from MS. I have written a USB Adapter with
CDC interface, this solutions works.

The limitation (BUG I don’t now) is the transfer size.
When the user mode client will transmit more than 128
bytes you have a problem :frowning:

The ccport.sys will translate a big data block into
some 128 bytes packets and after first block completion
from my driver I cannot see a second block …
The transfer stops …

elli


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

hello,

forget my message … You will use VXD service from a
Kernel driver. Here a example

#define ID_Open_Boot_Log 0x00010188
#define ID_Write_Boot_Log 0x00010189
#define ID_Close_Boot_Log 0x0001018A

#define vxdCall(service) _asm _emit 0xcd _asm _emit 0x20 _asm _emit ((service) & 0xff) _asm _emit ((service) >> 8) & 0xff _asm _emit ((service) >> 16) & 0xff _asm _emit ((service) >> 24) & 0xff

BOOLEAN inline
Open_Boot_Log()
{
vxdCall(ID_Open_Boot_Log)
__asm xor eax,eax // 0 means enabled
__asm jnz notinst;
return TRUE;
notinst:
return FALSE;
}

void inline
Close_Boot_Log()
{
vxdCall(ID_Close_Boot_Log)
}

void inline
Write_Boot_Log(DWORD len, LPSTR what)
{
__asm mov edx,what
__asm mov ecx,len
vxdCall(ID_Write_Boot_Log)
}

elli


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

Hi Jaydev,
I have written the wrappers for the VCOMM services, but have prolems with
Read service. Following the code used for Read service. Could you tell me
where am I wrong? Are there any other services call before I invoke a Read
service? Note: I am not using any queues for the read/write operations. And
I am relying on the hyperterminal to configure the com port. Write is
working fine.

Here is the code:

int ReadComPort(char *buf)
{
__asm mov eax,pNum // Pointer to a int.
__asm push eax

__asm mov eax,1 // Trying to read only one byte as first try
__asm push eax

__asm mov eax,buf
__asm push eax

__asm mov eax,hdl // handle got from OpenComm.
__asm push eax

__asm int 0x20
__asm _emit 0x13
__asm _emit 0x00
__asm _emit 0x2b
__asm _emit 0x00
__asm add esp,16
__asm mov vcRetval,eax

return vcRetval;
}

Regards,
Chakri


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

Hi ,

I have written the wrappers for the VCOMM services, but have prolems with
Read service. Following the code used for Read service. Could you tell me
where am I wrong? Are there any other services call before I invoke a Read

have you set any read timeout before ?? Check this.

elli


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

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: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

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