IMbnRegistration::GetProviderID 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.

Gets the provider ID for the currently registered network.

Syntax

HRESULT GetProviderID(
  [out] BSTR *providerID
);

Parameters

[out] providerID

Pointer to a string that contains the ID of the currently registered provider. The maximum length is MBN_PROVIDERID_LEN characters. The string is filled only when the method returns S_OK for success. Upon success, the calling application must free the allocated memory by calling SysFreeString.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation was successful.
E_PENDING
The provider ID is not available. The Mobile Broadband service is currently probing the device for the information. When the provider ID is available, the Mobile Broadband service will call the OnRegisterModeAvailable method of IMbnRegistrationEvents.
E_MBN_PIN_REQUIRED
A PIN is required to get the provider ID.
MBN_SIM_NOT_INSERTED
A SIM is not inserted in the device.
E_MBN_BAD_SIM
A bad SIM is inserted in the device.

Remarks

The GetProviderID method gets the ID of the currently registered provider. For auto network selection mode this is the ID of the network to which the device is currently registered. If the network selection mode is manual then this field will contain the provider ID of the network to which device will try to register. For CDMA devices it is set to MBN_CDMA_DEFAULT_PROVIDER_ID if the provider ID is not known.

This information may change when the Mobile Broadband device moves from one network to another. This includes whenever there is a change from MBN_REGISTER_STATE_HOME to MBN_REGISTER_STATE_SEARCHING in the network registration state. This also occurs when there is a change in the registered network, such as when a network moves its registration from one provider to another. After such changes, the Mobile Broadband service will call the OnRegisterStateChange method of IMbnRegistrationEvents. When this happens, the application should call GetProviderID.

For the recoverable error E_MBN_PIN_REQUIRED, the Mobile Broadband service will again try to fetch this information from the device when the error condition is over (when a PIN is entered). Afterwards, the Mobile Broadband service will call the OnPacketServiceStateChange method of IMbnRegistrationEvents.

Requirements

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

See also

IMbnRegistration