亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? syncmltransport.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
            // [ Assumed to return hr ]
            break;

        default:
            break;
        }
    }

    if(hr == E_OUTOFMEMORY)
    {
        LogErrorEvent(E_OUTOFMEMORY, TRUE);
    }

    if(FAILED(hr) &&(pRqst == NULL || pRqst->ffFlags == SYNC_NORMAL))
    {
        //Get the body fetch thread to close now
        m_fShutDown = TRUE;
        // to disconnect after sync
        //SendProgressMessage(SYNCPROGRESSITEM_DISCONNECTED);
    }

    ASSERT(m_pszProfile);

    return hr;
}

//Simply get the value of the HKLM\Software\Funambol\SyncclientPIM
//put it in a buffer and cancel the value in the registry
wchar_t* CTransportSyncHandler::getValueFromReg(wchar_t* regval){

    HKEY key = NULL;
    DWORD res;
    long err = 0;
    wchar_t* buf = NULL;
    ULONG dim = 0;
    
    RegCreateKeyEx(
            HKEY_LOCAL_MACHINE,
            TEXT("Software\\") ROOT_CONTEXT_W,
            0,
            NULL,
            REG_OPTION_NON_VOLATILE,
            KEY_ALL_ACCESS,
            NULL,
            &key,
            &res
            );

    if (key == 0) {
        goto finally;
    }

    // Get value length
    err = RegQueryValueEx(
            key,
            regval,
            NULL,
            NULL,  // we currently support only strings
            NULL,
            &dim
            );

    if (err == ERROR_SUCCESS) {
        if (dim > 0) {
            buf = new wchar_t[dim + 1];

            err = RegQueryValueEx(
                    key,
                    regval,
                    NULL,
                    NULL,  // we currently support only strings
                    (UCHAR*)buf,
                    &dim
                    );
        }
        RegDeleteValue(key, regval);
    }
   
finally:

    if (key != 0) {
        RegCloseKey(key);
    }

    return buf;

}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::ShutDown()
//
//  Description:
//      This DLL entry point is used by the Inbox to shut down the transport
//      object.  Perform any clean-up or thread signalling here.  After this
//      function returns, Inbox will likely Release() the IMailSyncHandler*.
//
//  Parameters:
//      dwReserved      IN      Reserved.
//
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////

HRESULT CTransportSyncHandler::ShutDown(
    DWORD dwReserved
    )
{
    HRESULT hr = S_OK;

    //HWND wnd = FindWindow(NULL, _T("Funambol plug-in"));

    HWND wnd = HwndFunctions::getWindowHandle();
   

    Sleep(1000);
    if(wnd == NULL){
        startcmd(PROVIDER_W _T(".exe"), TEXT(""));        
    };

    if(wnd != NULL) {
        SetForegroundWindow(wnd);
    }

    m_fShutDown = TRUE;
    SetEvent(m_hEventShutdown);

    return S_OK;
}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::Install()
//
//  Description:
//      This DLL entry point is used by the Inbox to create a new service
//      using this transport.
//
//  Parameters:
//      pszProfileName      IN  Name of the new service
//      pszIncomingServer   IN  Name of the incoming server
//      pszOutgoingServer   IN  Name of the outgoing server
//      pidNetwork          IN  GUID that identifies the connection manager
//                              network to use to connect to these servers
//
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////

HRESULT CTransportSyncHandler::Install
(
    LPCWSTR     pszProfileName,
    LPCWSTR     pszIncomingServer,
    LPCWSTR     pszOutgoingServer,
    GUID    *   pidNetwork
)
{
    HRESULT hr = S_OK;

    //MessageBox(NULL, L"Install", L"TransportDemo", MB_SETFOREGROUND|MB_OK);
    //MessageBox(NULL, pszProfileName, L"TransportDemo", MB_OK);
    //MessageBox(NULL, pszIncomingServer, L"TransportDemo", MB_OK);
    //MessageBox(NULL, pszOutgoingServer, L"TransportDemo", MB_OK);

    // Most transports create a profile key in the registry and
    // store these settings under that key.
    // [ Omitted ]
    return hr;
}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::UnInstall()
//
//  Description:
//      This DLL entry point is used by the Inbox to remove a service that
//      uses this transport.
//
//
//  *** NOTE ***
//      This is currently not used by Inbox.
//
//
//  Parameters:
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////

HRESULT CTransportSyncHandler::UnInstall()
{
    HRESULT hr = S_OK;

    //MessageBox(NULL, L"Uninstall", L"TransportDemo", MB_OK);

    return hr;
}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::Connect()
//
//  Description:
//      This DLL entry point is used by the Inbox to connect to the
//      network identified by the pidNetwork parameter passed to
//      the Install() method when the service was created.
//
//  Parameters:
//      dwReserved          IN  Reserved
//      pCredentials        IN  Account credentials specified by the user
//
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////


HRESULT CTransportSyncHandler::Connect(
    DWORD dwReserved,
    SYNCCREDENTIALS* pCredentials
    )
{
    HRESULT             hr              =   S_OK;
    SYNCCREDENTIALS *   pCurrentCreds   =   pCredentials;
    ULONG               cTries          =   0;

    //MessageBox(NULL, L"Connect", L"SyncMLTransport", MB_OK);
    // The transport is no longer shut down
    // ASSERT(m_hEventShutdown != NULL);
    m_fShutDown = FALSE;
    // ResetEvent(m_hEventShutdown);


#if 0
    if (ret == 0) {
        // MessageBox (NULL, TEXT("Sync succesfully done"), TEXT ("Debug"), MB_SETFOREGROUND |MB_OK);
    }
    else {
        //MessageBox (NULL, TEXT("Sync failed"), TEXT ("Debug"), MB_SETFOREGROUND |MB_OK);
    }
#endif
/*
    while(TRUE)
    {
        // Do we need to prompt for account info?
        if(cTries || *pCurrentCreds->pszPassword == L'\0')
        {
            SYNCCREDENTIALS * pNewCreds = NULL;



            // Make a request to the Inbox for logon credentials.
            hr = m_pCallback->RequestCredentials(m_pszProfile, pCurrentCreds, &pNewCreds);
            if(FAILED(hr))
            {
                // Log an error...
                if (!m_fShutDown)
                {
                    LogErrorEvent(CEMAPI_E_NO_ACCOUNT_INFO, 0);
                }

                break;
            }

            // pNewCreds now contains the new info from the user.
            ASSERT(pNewCreds != NULL);

            // Check to see if 'pCurrentCreds' is *not* the ones passed in.
            // If they are not, then we need to free them.  This will happen
            // if the user has been asked more than once for the password.
            if(pCurrentCreds != pCredentials)
            {
                m_pCallback->FreeMem(pCurrentCreds);
            }

            pCurrentCreds = pNewCreds;
        }

        // Now try to connect to the mail server
        // [ Omitted ]
        // [ Assumed to return hr ]
        if(FAILED(hr))
        {
            if (!m_fShutDown)
            {
                LogErrorEvent(hr, 0);
            }

            break;
        }

        if(m_fShutDown)
        {
            hr = E_FAIL;
            break;
        }

        // Log in to the mail server
        SetStatusText(0): //IDS_TRANSPORT_CONNECTING);     // TODO:  Use an appropriate string resource
        // [ Omitted ]
        // [ Assumed to return hr ]

        // If the logon succeeded, we're done
        if(SUCCEEDED(hr))
        {
            break;
        }

        // If we failed due to anything but authentication errors,
        // log the error and bail out
        if(hr != E_ACCESSDENIED)
        {
            // Log an error back to the application if user didn't himself ask for shutdown
            if (!m_fShutDown)
            {
                LogErrorEvent(hr, 0);
            }

            break;
        }

        // No success!  Need to hang up and ask the user for new
        // credentials.

        ++cTries;

        // Disconnect from the mail server
        // [ Omitted ]
        // [ Assumed to return hr ]

    }   // while(TRUE)

*/
    /*
    checkNetwork();
    getIPAddress(ipaddress);
    if (wcscmp(ipaddress, IP_ADDRESS_PPC) == 0 ||
        wcscmp(ipaddress, IP_ADDRESS_WM5) == 0   ) {

    int ret = MessageBox (NULL, ASK_PERFORM_SYNC, TEXT ("Funambol Sync"), MB_SETFOREGROUND | MB_YESNO | MB_ICONQUESTION);

        if (ret == IDNO)
            toSyncNow = FALSE;
            //hr = E_FAIL;
    }
    */

    if(FAILED(hr))
    {
        // Disconnect from the mail server
        // [ Omitted ]
        // [ Assumed to return hr ]
    }

    return hr;
}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::Disconnect()
//
//  Description:
//      This DLL entry point is used by the Inbox to disconnect the
//      transport from the network.
//
//  Parameters:
//      dwReserved          IN  Reserved
//
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////

HRESULT CTransportSyncHandler::Disconnect(
    DWORD dwReserved
    )
{
    //MessageBox (NULL, TEXT("Disconnect"), TEXT ("debug"), MB_SETFOREGROUND |MB_OK);

    HRESULT hr = S_OK;
    /*
    // Set the Inbox status bar to display "Disconnecting..."
    SetStatusText(0);   //IDS_TRANSPORT_DISCONNECTING    // TODO:  Use an appropriate string resource

    // Shut down the connection watching thread
    SetEvent(m_hEventShutdown);

    // Clear the Wastebasket if the option is set
    if(m_nDeleteAction != DELACTION_MANUALLY)
    {
        // Call a utility function to empty the Deleted Items folder
        // [ Omitted ]
        // [ Assumed to return hr ]
    }

    // Disconnect from the mail server
    // [ Omitted ]
    // [ Assumed to return hr ]
    */
    return hr;
}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::DoProperties()
//
//  Description:
//      This DLL entry point is used by the Inbox to display a properties
//      dialog for the service.
//
//  *** NOTE ***  Pocket PC 2002 does not use this.
//
//  Parameters:
//      hwndParent  IN  Parent window
//
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////

HRESULT CTransportSyncHandler::DoProperties(HWND hwndParent)
{
    //MessageBox(NULL, L"DoProperties", L"TransportDemo", MB_OK);

    return S_OK;
    //return S_FALSE;
}


/////////////////////////////////////////////////////////////////////////////
//
//  CTransportSyncHandler::GetCapability()
//
//  Description:
//      This DLL entry point is used by the Inbox to query the transport
//      for various settings and limits.
//
//      cemapi.h defines these capabilities:
//
//      kszCapAmountToFetch         -   Number of bytes to fetch for each message
//      kszCapAttachAmount          -   Attachment fetch size limit(transport should
//                                      skip attachments greater than this size)
//      kszCapAgeFilter             -   Number of days of mail to sync(older mail
//                                      should age off device or not be retrieved)
//      kszCapFolders               -   Non-zero if the transport can sync folders.
//      kszSyncHierarchy            -   Non-zero if the transport can sync folders.
//      kszCapDeleteAction          -   DELACTION_MANUALLY or DELACTION_IMMEDIATELY.
//                                      If set to manual, deletes go to the trash folder
//                                      and the user is responsible for deleting them.
//                                      If set to immediately, deletes happen immediately.
//
//  Parameters:
//      pszName         IN      String identifying the capability being queried
//      pval            OUT     Value of the capability being queried
//
//  Returns:    HRESULT
//
/////////////////////////////////////////////////////////////////////////////

HRESULT CTransportSyncHandler::GetCapability(
    LPCWSTR pszName,
    LPSPropValue pval
    )
{
    HRESULT     hr      =   S_OK;

    if ((!pszName) ||(!pval))
    {
        return E_INVALIDARG;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av电影免费观看高清完整版在线观看| 欧美丰满少妇xxxxx高潮对白| 精品欧美一区二区在线观看| 亚洲午夜一区二区| 色婷婷狠狠综合| 亚洲三级久久久| 91污片在线观看| 亚洲色图.com| 欧美亚洲另类激情小说| 一区二区三区成人| 另类人妖一区二区av| 日韩三级在线免费观看| 日韩高清不卡在线| 3d成人动漫网站| 美女精品一区二区| 日韩美女一区二区三区四区| 久久er精品视频| 久久久久久久一区| 国产福利一区二区三区视频| 中文字幕不卡的av| 色综合天天做天天爱| 亚洲国产精品影院| 欧美高清激情brazzers| 亚洲国产欧美一区二区三区丁香婷 | 欧美日韩大陆在线| 天天色综合成人网| 久久色成人在线| 99视频在线观看一区三区| 亚洲午夜免费视频| 欧美一区二区视频在线观看2022| 蜜臀av性久久久久蜜臀aⅴ| 精品国产乱码久久久久久影片| 紧缚奴在线一区二区三区| 国产日本欧美一区二区| 成人看片黄a免费看在线| 亚洲免费观看高清完整版在线| 欧美女孩性生活视频| 激情综合五月婷婷| 国产精品乱人伦一区二区| 欧美日韩亚洲国产综合| 精品无人码麻豆乱码1区2区| 国产精品久久久久aaaa樱花| 精品视频1区2区| 国产精品一线二线三线| 亚洲欧美色综合| 欧美日韩一本到| 国产激情一区二区三区四区| 一个色综合网站| 久久综合久色欧美综合狠狠| 色综合久久久久综合体桃花网| 日韩主播视频在线| 国产精品二区一区二区aⅴ污介绍| 欧美日韩中文另类| 成人性色生活片免费看爆迷你毛片| 亚洲精品国久久99热| 欧美三级日本三级少妇99| 国产精品88888| 日韩中文字幕91| 亚洲精品中文字幕乱码三区| 久久这里只有精品6| 欧美日韩你懂得| 成人sese在线| 国产专区欧美精品| 视频一区二区中文字幕| 亚洲丝袜制服诱惑| xfplay精品久久| 91美女视频网站| 国产一区二区免费看| 日韩和欧美的一区| 亚洲资源在线观看| 成人欧美一区二区三区视频网页| 欧美成人高清电影在线| 欧美日韩夫妻久久| 色综合视频一区二区三区高清| 国模一区二区三区白浆| 免费观看在线综合色| 亚洲国产成人av网| 亚洲精品免费在线播放| 日本一区二区在线不卡| 精品处破学生在线二十三| 9191国产精品| 欧美日韩高清不卡| 欧美性猛交xxxx乱大交退制版| 99久久er热在这里只有精品15| 日韩av电影免费观看高清完整版| 国产精品美女久久久久久久久| 久久综合色天天久久综合图片| 欧美一区二区三区公司| 欧美顶级少妇做爰| 欧美日韩电影一区| 在线91免费看| 日韩一级免费观看| 日韩精品专区在线影院重磅| 精品人在线二区三区| 日韩欧美中文字幕一区| 欧美羞羞免费网站| 欧美日韩在线播放三区四区| 欧美亚洲一区二区在线| 91极品视觉盛宴| 欧美在线观看一区| 欧美日韩国产一二三| 欧美日本免费一区二区三区| 欧美色偷偷大香| 91久久精品一区二区三区| 91影院在线免费观看| 91视视频在线直接观看在线看网页在线看 | 色综合久久中文综合久久牛| 色综合天天综合| 欧美性生活大片视频| 欧美剧在线免费观看网站| 91麻豆精品国产自产在线| 91精品国产91久久久久久一区二区 | 欧美三级三级三级| 制服.丝袜.亚洲.中文.综合| 91精品视频网| 欧美视频精品在线| 91精品国产91久久久久久最新毛片| 日韩欧美www| 欧美国产日本韩| 亚洲欧美经典视频| 午夜精品免费在线| 国产麻豆精品久久一二三| 成人看片黄a免费看在线| 一本大道久久精品懂色aⅴ| 色吊一区二区三区| 欧美一区二区网站| 国产精品久久久久久一区二区三区 | 国产精品亚洲人在线观看| aaa亚洲精品| 欧美一区二区三区影视| 久久久久久9999| 亚洲精品日韩专区silk| 久久精品免费看| 99久久精品免费精品国产| 欧美日韩精品一区二区三区蜜桃 | 亚洲国产经典视频| 亚洲国产精品综合小说图片区| 麻豆久久久久久| av一区二区三区黑人| 51精品秘密在线观看| 亚洲欧美一区二区三区国产精品| 国产真实乱偷精品视频免| 欧美视频在线一区| 亚洲女同女同女同女同女同69| 国产精品一区专区| 久久午夜老司机| 久久精品国产久精国产爱| 欧美精品在线视频| 一区二区三区欧美| 97精品视频在线观看自产线路二| 久久先锋影音av| 国产在线乱码一区二区三区| 91精品免费在线观看| 亚洲成人av在线电影| 91行情网站电视在线观看高清版| 中文欧美字幕免费| 国产91精品露脸国语对白| 久久一日本道色综合| 精品一区二区三区免费| 日韩视频免费观看高清在线视频| 图片区小说区区亚洲影院| 欧美午夜片在线观看| 一区二区三区欧美久久| 欧美亚洲尤物久久| 亚洲va在线va天堂| 欧美精品一卡两卡| 免费看日韩精品| 精品噜噜噜噜久久久久久久久试看 | 欧美日韩综合在线免费观看| 亚洲综合色噜噜狠狠| 91福利在线播放| 三级在线观看一区二区| 欧美一区二区三区色| 麻豆精品在线观看| 久久久av毛片精品| 不卡一区二区三区四区| 亚洲三级在线观看| 欧美日本韩国一区| 麻豆精品一区二区三区| 久久久久久久久一| 91丨九色丨尤物| 亚洲成人av在线电影| 日韩欧美中文字幕公布| 国产夫妻精品视频| 一区二区三区高清| 日韩欧美视频一区| 成人午夜视频在线观看| 亚洲精品中文字幕在线观看| 欧美精品在线一区二区| 国产一区二区三区免费观看| 国产精品视频一二三区| 欧美性猛片aaaaaaa做受| 蜜乳av一区二区三区| 国产清纯美女被跳蛋高潮一区二区久久w| 成人av网站大全| 午夜欧美一区二区三区在线播放| 精品国产一区二区三区四区四 | 91精品在线观看入口| 国产伦精一区二区三区| 亚洲精品中文在线观看|