IMbnMultiCarrier::SetHomeProvider 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.

Updates the home provider for a multi-carrier device.

Syntax

HRESULT SetHomeProvider(
  [in]  MBN_PROVIDER2 *homeProvider,
  [out] ULONG         *requestID
);

Parameters

[in] homeProvider

An MBN_PROVIDER2 structure that contains the home provider.

Note  

The SignalStrength and SignalError members must be 0.

 

[out] requestID

A pointer to the request ID set by the operating system for this request. The asynchronous response from OnSetHomeProviderComplete will contain this same requestID.

Pointer to the request ID set by the operating system for this request. The asynchronous response will contain this same requestID.

Return value

This method can return one of these values.

Return code Description
S_OK
The method completed successfully.
HRESULT_FROM_WIN32(ERROR_SERVICE_NOT_ACTIVE)
The Mobile Broadband service is not running on this system.
E_HANDLE
Invalid interface. The Mobile Broadband device has probably 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_NOT_SUPPORTED)
The operation is not supported by the device. This may be returned by devices which do not support multi-carrier.

Remarks

The SetHomeProvider method initiates an update of the home provider for the interface. This is an asynchronous operation, and the method call returns immediately. If this method returns successfully with S_OK, then Windows will notify the calling application about the completion status of this operation by calling the OnSetHomeProviderComplete method of IMbnMultiCarrierEvents.

The device will then automatically come up registered to the new network and indicate a registration state change. The device will continue to come up registered to this new home network across Windows reboots unless SetHomeProvider is used again to set a new home provider.

If the device is removed from the system before this operation is complete, there is no guarantee that the completion notification will be received by the calling application.

Requirements

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

See also

IMbnMultiCarrier