I've a problem with my old Win9x VxD driver in WinME.
This is the scenario:
My serial driver (or any serial driver - I've also tried Walter Oney's
good old VxD serial driver) works in Win9x but not in WinME.
The problem arises when a second app tries to open the already opened
serial port. The driver is capable of noticing that it is already
loaded (wow..) but it can't tell the system (VCOMM) that without
destroying something in VCOMM really bad.
The first result is that VCOMM fails to load my driver (what I want)
but the second unwanted result is that VCOMM seems to keep some handle
to the driver open, and when all apps are finished, VCOMM feels
confused and skips to unload the driver (it calls "Close", but not
OnSysD..Exit).
I've tried to fail on various places:
1. DriverControl: If I return FALSE here, VCOMM tries to open the
driver anyway (by the Open-function of the FIRST instance)
2. After the VCOMM call "AddPort" (which fails with IE_OPEN).
3. In Open (after AddPort).
4. With or without the whole Acquire/StealPort/CondendProc-mechanism.
All above gives the same result - the driver just won't be unloaded.
I've been busy with this for a while now, and even stepped through the
similiar wdm-driver "ccport.sys". Strange enough, ccport handles this
scenario fine, and the only differnece is the result values
of "PortOpen".
In Walter's driver it states that the return value should be NULL, and
the error code should be stored in a pointer passed to PortOpen. Ccport
however, moves the errorcode (IE_OPEN) to EAX; i.e. a return value.
Why?
This slight difference does not mean anything for my problem, but it is
interesting anyhow.
Finally, does anyone understand why Microsoft suddenly determines to
change a such rudimentary component as VCOMM in the (hopefully!) final
release of this OS?
Thanks!
/Pelle Hamberg
Sent via Deja.com http://www.deja.com/
Before you buy.