Share via


A version of this page is also available for

Windows Embedded CE 6.0 R3


This function initializes RIL for use by a client.


HRESULT RIL_Initialize(
  DWORD dwIndex,
  DWORD dwNotificationClasses,
  DWORD dwParam,
  HRIL* lphRil


  • dwIndex
    Specifies the index of the RIL port to use, for example, 1 for RIL1:.
  • pfnResult
    Function result callback.
  • pfnNotify
    Notification callback.
  • dwNotificationClasses
    Specifies the classes of notifications to be enabled for a client.
  • dwParam
    Specifies the custom parameter passed to result and notification callbacks.
  • lphRil
    Returned Handle to the RIL instance.

Return Value

The function returns the following values:

Value Description


The driver is up and radio is present.


The driver is still waiting for radio presence.


The call to initialize the driver has failed.


This function is synchronous. Synchronous RIL only supports single-threaded RIL handles. The RIL validates the application's RIL handle before using it. An application cannot use a RIL handle that it does not own.

Call RIL_Deinitialize to release the handle. If the RIL client generates an exception or exits without calling RIL_Deinitialize, the RIL library will release the handle when the DLL is unloaded.


You should not use CloseHandle to release this handle.

When a client calls RIL_Initialize, it can also register for notifications. If it registers for notifications, the driver will send a RIL_NOTIFY_RADIOPRESENCECHANGED indicating if the radio is present or not present. The proxy returns S_FALSE as an indication that the driver has not detected the radio presence yet. The pending notification is used by the client to determine when the radio is present. For more information about RIL_NOTIFY_RADIOPRESENCECHANGED, see Notification Radio State Change Constants.

If the client does not register for notifications when RIL_Initialize is called, it has two options.

The client can periodically call RIL_DeInitialize and then call RIL_Initialize until the proxy returns S_OK.

  1. The client can periodically call RIL_DeInitialize and then call RIL_Initialize until the proxy returns S_OK.
  2. The client can periodically call the desired RIL_API until the API no longer returns RIL_E_RADIOPRESENT.


Header ril.h
Library Ril.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also


RIL Functions
Error Constants