Connection setting for Multiple PDP RRS feed

  • Question



    In case of device is set for Multiple PDP, if Private APN is established, application which is connected by Public APN can not be connected with Public APN as usual.

    (If Private APN is not established, this application can be connected with Public APN.)



    1. Set registry setting for Multiple PDP.

      In specified folder for SIM card under [HKEY_LOCAL_MACHINE\Software\OEM\RIL\OperatorContexts\]

                      GPRSContextNumber = 3

                      UMTSContextNumber = 2

    2. Set Public APN information.

    3. Set Private APN information.



    1. Establish Public APN.

    2. Connect by application (Update information of application) → OK

    3. Establish Private APN.

    4. Connect by application (Update information of application) → NG

    5. Terminate Private APN connection.

    6. Connect by application (Update information of application) → OK



    By above steps, in case of PIE is used instead of our application, PIE can connect with Public APN even Private APN is established at the same time.

    We would like to know how to connect with Public APN while Private APN is established as PIE.

    We appreciate if it you could give us any comment.

    (Windows Mobile 6)
    Wednesday, February 18, 2009 7:25 AM

All replies

  • Hi,
    I add some details with some code as follows.

    - In environment for Multiple PDP.  
    - Connecting to Private APN already.  
    On the above situation, following process is started.  
    - Step  
    1. Connect to Public APN by ConnectionManager  
        DWORD ConnectionThread()  
            HANDLE hThisThread=m_hConnectionThread;  
            HANDLE hConnection = NULL;  
            CONNMGR_CONNECTIONINFO ConnInfo={0};  
            ConnInfo.dwFlags=GetProxy() ? CONNMGR_FLAG_PROXY_HTTP: 0;  
            ConnInfo.dwPriority=CONNMGR_PRIORITY_USERINTERACTIVE ;  
            ConnInfo.guidDestNet = GetNetworkGuid();  
            HRESULT hr = ConnMgrEstablishConnection(&ConnInfo, &hConnection);  
            if( FAILED( hr ) )  
    #if __TEST__  
                HANDLE hObjects[2];  
                BOOL    bStop=FALSE;  
                while( bStop == FALSE )  
                    DWORD dwResult = WaitForMultipleObjects( 2, hObjects, FALSE, INFINITE);   
                    if (dwResult == (WAIT_OBJECT_0))  
                        HRESULT hr;  
                        DWORD   dwStatus;  
                        m_dwStatus = dwStatus;  
                        if( SUCCEEDED(hr))  
                            if( DoStatusUpdate(m_dwStatus) != S_OK )  
                    else // failures, or signalled to stop.  
                        bStop = TRUE;  
            // Release the connection, caching if we should.  
            if( hConnection )  
                ConnMgrReleaseConnection(hConnection, GetCache() );  
            m_hConnection = hConnection;  
            return GetStatus();  
    2. Connect to network by InternetOpen and InternetOpenUrl.  
        InternetGetConnectedState(&dwFlags, 0);  
        if((dwFlags & INTERNET_CONNECTION_PROXY))  
            m_ifProxy = true;  
            m_ifProxy = false;  
            hInternet = InternetOpen(m_szAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);  
            hInternet = InternetOpen(m_szAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);  
        TCHAR szHead[] = L"Accept: */*\r\n\r\n";  
        long filelen = 0;  
        int count = 0;  
        while( !(hFile = InternetOpenUrl( hInternet,wstrUrl, szHead,  
             wcslen(szHead), INTERNET_FLAG_RELOAD, 0)))  
            DWORD err = GetLastError();  
            if(count >= 3)  
        if(hFile != NULL) {  
            DWORD dwTotal;  
            if( InternetQueryDataAvailable( hFile, &dwTotal, 0 , 0 ) == TRUE ){  
                HANDLE hWriteFile = CreateFile(lpszPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);  
                LPDWORD pdwData;  
                DWORD dwBytesToRead;  
                DWORD dwWritten;  
                pdwData = (LPDWORD)GlobalAlloc(GMEM_MOVEABLE | GMEM_NODISCARD, dwTotal);  
                    InternetReadFile(hFile, pdwData, dwTotal, &dwBytesToRead);  
                    if( dwBytesToRead == 0 ){  
                    WriteFile(hWriteFile, pdwData, dwBytesToRead, &dwWritten, NULL);  
            er = 1;  
            goto err;  
    3. At the moment when InternetReadFile is executed, program is stopped for long.  
      ->After stopped for a few minutes, time out is done.  
      Error code by GetLastError() is ERROR_INTERNET_TIMEOUT  
    - ConnectionManager is based on cmhelper code which is MS sample code.  
    - When code between #if __TEST__ and #endif is commented out, this issue does not happened.  

    But I am not sure if this part is the cause of this issue.

    I am not sure correct part of this issue.

    Hope I can have answer.
    Tuesday, March 3, 2009 3:22 AM