IVIO_Device::set_AccessMode

This method sets the access mode—either shared or exclusive access—for the device. The mode is used with a read or write mode.

Syntax

HRESULT IVIO_Device::set_AccessMode( DWORD dwMode, DWORD dwAccessMode );

Parameters

[in] dwMode
Specifies the mode for which the access is to be set. It is one of the following values:
VIODEVICEMODE_READ
Sets the device’s read access.
VIODEVICEMODE_WRITE
Sets the device’s write access.
dwAccessMode
[in] Specifies the type of access requested for the device’s modes. The following table shows possible values for this parameter.
Access
Value
Description
VIODEVACCESS_SHARED 0x0000 Sets the device as a shareable device
VIODEVACCESS_EXCLUSIVE 0x8000 Sets the device as an exclusive device that cannot be shared

Return Values

One of the values described in the following table is returned.

Value
Description
S_OK The access mode was successfully set.
E_INVALID One of the parameters is invalid.
E_ACCESSDENIED The application was unable to change the access mode because another process or thread has already set the access.