This CLSID locks and unlocks power locks.
Note This feature is not available on most vehicles initially.
Power lock state
Read or write, shareable or exclusive
Type: | VT_UI4 (unsigned long binary value) |
The following list provides the lock states and values.
Power lock state |
Enumeration |
VIOLOCKS_UNLOCKED | 0 |
VIOLOCKS_LOCKED | 1 |
Type: | VT_UI4 (unsigned long binary) |
Value: | One of the defined VIO_LOCKS_* values |
Type: | VT_UI4 (unsigned long binary) |
Value: | One of the VIO_LOCKS_* values for current lock status |
API device objects expect the following data types and sizes when sending data to and from the mini-drivers:
Type: | DWORD * |
Size: | 4 bytes |
Description: | Bitmask that contains the lock state in VIOLOCKS_* form. |
Type: | DWORD * |
Size: | 4 bytes |
Description: | Bitmask that contains the requested lock state in VIOLOCKS_* form. |
HRESULT hr;
IVIO_Device *pLockState;
VARIANT vLockInfo;
//Initialize the VARIANT.
VariantInit(&vLockInfo);
hr = CoCreateInstance(CLSID_VIO_LOCK_STATE, NULL,
CLSCTX_INPROC_SERVER, IID_VIODEVICE,
&pLockState);
//Set the VARIANT to lock the doors.
vLockInfo.vt = VT_UI4;
vLockInfo.ulVal = VIOLOCKS_LOCKED;
//Send the command to the vehicle.
pLatchControl->SetData(&vLatchState, 3000);
//Release the reference to the interface.
pLockState->Release();