FtVspcGetQueryOpen Function

Retrieves value of QueryOpen flag for virtual serial port with non-standard name.

BOOL FtVspcGetQueryOpen(
	LPCTSTR lpszPortName,
	BOOL* lpbQueryOpen 



[in] The name of virtual serial port.


[out] A pointer to the variable where the QueryOpen flag of virtual serial port is returned.

Return Value

If the function succeeds, the return value is TRUE. Otherwise, use FtVspcGetLastError to get the error code (FtVspc_ErrorCode).


ftvspcErrorFailed 1 The operation has not been completed.
ftvspcErrorInvalidParameter 2 Invalid parameter.
ftvspcErrorNoSuchPort 101 There is no such port.
ftvspcErrorMarkedForDeletion 202 This port is marked for deletion.


QueryOpen flag allows the developer to react on virtual serial port opening. So, your application can allow or prohibit access to the serial port.
If QueryOpen is FALSE, the port can be open by any application.
If QueryOpen is TRUE, it is still not possible to open port if your application is not attached to the port (refer to FtVspcAttach). ERROR_ACCESS_DENIED error code is returned in such case. If attached, ftvspcPortEventQueryOpen event fires and the event handler decides, if it is allowed to open virtual serial port to the application or not.

See Also

FtVspcSetQueryOpen, FtVspcGetQueryOpenByNum, FtVspcAttach