_VCOMM_OpenComm


include vcomm.inc

VxDcall _VCOMM_OpenComm, <<OFFSET32 PortName>, VMId>
mov     hPort, eax

Opens a communications resource. Uses the C calling convention.

Value

Meaning

IE_BADID

The port does not exist or no port driver is registered for it.

IE_OPEN

The port is already open.


PortName

Address of a null-terminated string that specifies the port name.

VMId

Handle of the VM to which ownership of the port is assigned, or -1 to open the port in exclusive mode. This parameter is ignored unless a VxD is installed that virtualizes the port and detects contention. For COMM ports 1 through 4, VCD.386 detects contention.

To close the communications resource, use the _VCOMM_CloseComm service. You must close any communications resource you open. A VxD that opens a communications resource for use in a virtual machine (VM) must process the VM_Not_Executeable event to close the resource if the VM terminates.

See also _VCOMM_CloseComm