Edit

Share via


IMbnConnectionProfileManager::GetConnectionProfile 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 a specific connection profile associated with the given Mobile Broadband device.

Syntax

HRESULT GetConnectionProfile(
  [in]          IMbnInterface         *mbnInterface,
  [in]          LPCWSTR               profileName,
  [out, retval] IMbnConnectionProfile **connectionProfile
);

Parameters

[in] mbnInterface

An IMbnInterface that represents the device for which the profile request applies. If mbnInterface is NULL, then this function will return the profile of the given name associated with any device in the system.

[in] profileName

A null-terminated string that contains the name of the connection profile.

[out, retval] connectionProfile

An IMbnConnectionProfile interface that represents the desired connection profile. If this method returns anything other than S_OK, this is NULL.

Return value

This method can return one of these values.

Return code Description
S_OK
The method completed successfully.
E_HANDLE
The interface is invalid, most likely because the Mobile Broadband device has been removed from the system.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
A profile with the given name does not exist.
HRESULT_FROM_WIN32(ERROR_NOT_READY)
The device is not ready. Unable to obtain the subscriber ID because the device is not MBN_READY_STATE_INITIALIZED.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
A profile with the given name does not exist.

Remarks

A connection profile is associated with the subscriber ID of the device. For GSM devices the subscriber ID is the International Mobile Subscriber Identity (IMSI) of the SIM. For CDMA devices it is the Mobile Identification Number (MIN) string or the International Roaming MIN (IRM) string.

If a new profile has been created using CreateConnectionProfile, then the caller must wait for the OnConnectionProfileArrival event to be received before calling GetConnectionProfile with the new profile's name; otherwise, the GetConnectionProfile API call may fail with HRESULT_FROM_WIN32(ERROR_NOT_FOUND).

Requirements

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

See also

IMbnConnectionProfileManager