FtVspcGetQueryOpenByNum Function

Retrieves value of QueryOpen flag.

BOOL FtVspcGetQueryOpenByNum(
	UINT unPortNo,
	BOOL* lpbQueryOpen 
	);

Parameters

unPortNo

[in] The number of virtual serial port.

lpbQueryOpen

[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).

Errors

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.

Remarks

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

FtVspcSetQueryOpenByNum, FtVspcGetQueryOpen, FtVspcAttach