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 home provider.
HRESULT GetHomeProvider( MBN_PROVIDER *homeProvider );
A pointer to an MBN_PROVIDER structure that represents the home provider. If this method returns any value other than S_OK, this parameter is NULL. Upon completion, the calling application must free the memory allocated to the providerID and providerName members of MBN_PROVIDER by calling SysFreeString
This method can return one of these values.
||The method completed successfully. homeProvider contains valid values.|
||The information is not available. The Mobile Broadband service is currently probing to get the home provider. The calling application can get notified when the home provider is available by registering for the OnHomeProviderAvailable method of IMbnInterfaceEvents.|
||The device requires that a PIN must be entered for this operation.|
||The SIM is not inserted.|
||A bad SIM is inserted in the device.|
||Unable to read from the SIM or device memory. For example, the SIM does not have home provider information provisioned.|
GetHomeProvider returns the home provider information for the device. The dataClass field of returned MBN_PROVIDER structure should be ignored.
For the recoverable errors E_MBN_PIN_REQUIRED, E_MBN_SIM_NOT_INSERTED, and E_MBN_BAD_SIM, the Mobile Broadband service will query the device again for the home provider when the error condition is over. For example, if the device requires a PIN to be entered to retrieve this information, then it will return E_MBN_PIN_REQUIRED. When the application enters the PIN to unlock the device, then the Mobile Broadband service will again try to get this information from the device. The system will update the application about the status of new query by calling the OnHomeProviderAvailable method of IMbnInterfaceEvents.
The registered OnHomeProviderAvailable method of IMbnInterfaceEvents can be either called when home provider information is available or the new query completed with error. Once this function returns success then this information will never change.
|Minimum supported client||Windows 7 [desktop apps | UWP apps]|
|Minimum supported server||None supported|