Tech Support > Microsoft Windows > Drivers > about function COM_IOControl in Virtual COM driver
about function COM_IOControl in Virtual COM driver
Posted by panyul on May 5th, 2008


hello,everybody!

I'm try to create a virtual COM driver.
when i applying the function COM_IOControl:
DWORD COM_IOControl(DWORD hOpenContext,DWORD dwCode,PBYTE pBufIn,DWORD
dwLenIn,PBYTE pBufOut,DWORD dwLenOut,PDWORD pdwActualOut)

i've received some values of dwCode parameter,like
0x1B0050 1769552
0x1B0054 1769556
0x1B003C 1769532
0x1B0048 1769544
0x1B0028 1769512
0x1B0044 1769540
but i don't know what these mean.

Can you help me ?
Thanks!


Posted by chris.aseltine@gmail.com on May 5th, 2008


On May 5, 12:31 am, "panyul" <pan_...@21cn.com> wrote:

Open ntddser.h. Take the last byte of each code (0x50, 0x54, 0x3C,
etc.) and convert to decimal, then divide by four. Then match it
against the list of serial IOCTLs in the file.

Posted by Maxim S. Shatskih on May 5th, 2008


I think this is about WinCE, and WinCE can have another IOCTL codes.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

<chris.aseltine@gmail.com> wrote in message
news:fb843c94-86b4-47c7-96f2-90a6ae3ffab9@x35g2000hsb.googlegroups.com...

Posted by panyul on May 9th, 2008


Thanks! I 've got it.
function = (dwCode & 0x3FFC) / 4; Then the value of function is defined in
serial IOCTLs

now i have another question, when ioctl code is IOCTL_SERIAL_SET_WAIT_MASK,
what should i do?

next is the steps in my opinion, are they right ? my driver is running in
WinCE.
1. save the event mask value;
2. use a thread to check the event completed or not;
3. if the event completed,then set the event to resume application. (how can
i set the event to resume application?)

Thanks for your answer!


"Maxim S. Shatskih" <maxim@storagecraft.com> ????
news:exk4tttrIHA.5068@TK2MSFTNGP02.phx.gbl...


Posted by chris.aseltine@gmail.com on May 9th, 2008


On May 8, 10:48 pm, "panyul" <pan_...@21cn.com> wrote:

Look at the serial sample in the WDK for an example. But basically,
there's only two things you need to do:

1) Set the wait mask that's given.

2) If there was an existing IOCTL_SERIAL_WAIT_ON_MASK pending in your
driver, complete it.

You don't do any other work here to handle this IOCTL. Later on,
you'll potentially complete IOCTL_SERIAL_WAIT_ON_MASK in a variety of
places and situations in your driver. When you complete the wait-on-
mask IOCTL later on, the application will "resume".


Similar Posts