previous page: 11.3: PortOpen Errors
page up: Programming VCOMM FAQ
next page: 11.5: Other Errors

11.4: Contention Management Errors


This article is from the Programming VCOMM FAQ, by nelson@desktop.nsc.com (Taed Nelson) with numerous contributions by others.

11.4: Contention Management Errors

[Contributed by Taed Nelson (nelson@lan.nsc.com).]

VtoolsD version 2.02 uses a different contention management method for
Windows 95. This new method is only documented in the new version of
the VCOMM documentation, which is available from the VCOMM archives.

The first problem was due to not reading the documentation closely enough. In
my INF file, I specified the contention handler as *VCD for my port driver,
which is on a non-standard port, COM5. I don't think that documentation makes
it clear if it is OK to use *VCD for non-standard ports, but it did not seem
to break under VTD 2.01.

Anyway, it is bad when using the new 2.02 way it will always say that it
failed to open the port in PortOpen. I just removed the Contention entry for
my port in the Registry, and that seemed to fix it. Without this entry, VCOMM
itself will do simple contention management.

[The remainder is believed to be fixed in version 2.03.]

The second problem is a minor but significant problem with Vireo's
implementation. VCOMM will not release a port unless the port driver provides
a notification function. (This seems like a stupid VCOMM requirement, but
that's another issue.)

The easy way around this is to override the function CtnNotifyHandler (I think
that's the name). For me, I just return TRUE in this function. I'm not sure
why this helps, since the base VcommPort provides one, but I have verified
this by stepping through the VCOMM assembly source. For some reason, if it is
not overridden, the creation of the thunk will return NULL, and VCOMM does not
like it. (Personally, I think that is a VCOMM misfeature, but it is
documented that way...)

The symptom of this bug is that you can open your port, and attempt to close
it (which fails, and you will hit a DEBUGWARN if you have that turned on), but
you will not be able to open it a second time without rebooting the machine.


Continue to:

previous page: 11.3: PortOpen Errors
page up: Programming VCOMM FAQ
next page: 11.5: Other Errors