IMbnConnectionContext::SetProvisionedContext method (mbnapi.h)

Important

Starting in Windows 10, version 1803, the Win32 APIs described in this section are replaced by the Windows Runtime APIs in the Windows.Networking.Connectivity namespace.

Adds or updates a provisioned context.

Syntax

HRESULT SetProvisionedContext(
  [in]  MBN_CONTEXT provisionedContexts,
  [in]  LPCWSTR     providerID,
  [out] ULONG       *requestID
);

Parameters

[in] provisionedContexts

An MBN_CONTEXT structure that specifies the provisioned context to be stored in the device or SIM.

[in] providerID

A string that represents the network provider ID for which the provisioned context should be stored. The device should return the added provisioned context in response to any subsequent query when a SIM with this home provider ID is in the device.

[out] requestID

A request ID set by the Mobile Broadband service to identify this asynchronous request.

Return value

This method can return one of these values.

Return code Description
S_OK
The method completed successfully.
E_HANDLE
Invalid interface. Most likely the Mobile Broadband device has been removed from the system.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
Invalid interface. Most likely the Mobile Broadband device has been removed from the system.
HRESULT_FROM_WIN32(ERROR_SERVICE_NOT_ACTIVE)
The Mobile Broadband service is not running on this system.
E_INVALID_ARG
providerID is not valid.

Remarks

The contextID of provisionedContexts specifies the index in the device or SIM memory where the context is to be stored. If it is set to MBN_CONTEXT_ID_APPEND, then the device shall find the appropriate index to store the context.

This is an asynchronous operation and SetProvisionedContext will return immediately. When the operation is complete, the Mobile Broadband service will notify the application by calling the OnSetProvisionedContextComplete method of IMbnConnectionContextEvents.

Additions to the provisioned context list for the current home provider ID will not be available for querying until the OnProvisionedContextListChange method of IMbnConnectionContextEvents has been called.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header mbnapi.h

See also

IMbnConnectionContext