Unlock a device

A subset of the mobile broadband API includes the PIN Management API. To unlock a device, do the following:

  1. Get the network adapter ID for the account device:

    account.currentNetwork.networkAdapter. networkAdapterId
  2. Create an IMbnInterfaceManager instance.

  3. Advise to the IMbnPinManagerEvents and IMbnPinEvents connection points (these are used for getting PIN state and unblock/unlock results). For more info, see the Remarks section of IMbnInterfaceManager.

  4. Pass the network adapter ID into IMbnInterfaceManager::GetInterface to get an IMbnInterface interface for the device.

  5. Get an IMbnPinManager interface for the device by calling IMbnInterface::QueryInterface.

  6. Call IMbnPinManager::GetPinState to get the PIN state of the device (the state returned by using the connection point that was registered in step 3).

  7. Determine how the device is locked or blocked by using the MBN_PIN_INFO::pinState parameter that is passed into the event.

  8. Get an IMbnPin interface for the appropriate PIN by calling IMbnPinManager::GetPin.

  9. Call either IMbnPin::Enter or IMbnPin::Unblock, based on how the device is locked (see step 7).

  10. Listen for Unlock or Unblock results by using IMbnPinEvents registration to know whether the operation was successful.

Related topics

Common tasks for mobile broadband Windows Runtime APIs

Send comments about this topic to Microsoft