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

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

?? startsync.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
            wcscmp(command, PARAM_ADDRESSCHANGE) == 0 ||
            wcscmp(command, PARAM_REGISTER) == 0 ||
            wcscmp(command, PARAM_DEREGISTER) == 0 ||
            wcscmp(command, PARAM_NOTIFY) == 0 ||
            wcscmp(command, PARAM_TRANSPORT) == 0 ||
            wcscmp(command, PARAM_INCLUSIVE) == 0 ||
            wcscmp(command, PARAM_MANUAL) == 0 ||
            wcscmp(command, PARAM_REFRESHSERVER) == 0 ||
            wcscmp(command, PARAM_REFRESHCLIENT ) == 0 ||
            wcscmp(command, PARAM_T_REFRESHSERVER) == 0 ||
            wcscmp(command, PARAM_T_REFRESHCLIENT ) == 0 ||
            wcscmp(command, c_szParams) == 0 ||
            wcscmp(command, PARAM_TCPIP) == 0 ||
            wcscmp(command, APP_RUN_AT_TIME) == 0 
            ) ) {

                quit(0);
        }
        /*
        * These two following test are only to understand and make right 
        * modification. So the Cradle action is normalized and the RunAppAtTime
        * currently only schedules the next time sync and leaves to the flow
        * the right choice.
        */
        if (wcsicmp(command, PARAM_NOTIFY) == 0 ){
            //This if for the on cradle notification
            delete [] command;
            command = wstrdup(TEXT("cradle"));
            //command = TEXT("cradle");
            if (sources){
                delete [] sources;
            }
            sources = NULL;
        } else if(wcscmp(command, APP_RUN_AT_TIME) == 0 ){
            LogLevel l = getLOGLevel();
            LOG.setLevel(l);
            schedule(false);
        } 
        
        if(wcscmp(command, PARAM_AVAILABLE) == 0) {
            getAvailability();
        } else if(wcscmp(command, PARAM_REMOVENOTIF) == 0) {
            removeNotif();
            retValue = NOT_RETURN_TO_MAIN_FORM;            
        } else if(wcscmp(command, PARAM_SCHEDULE) == 0) {
            LogLevel l = getLOGLevel();
            LOG.setLevel(l);
            schedule(true);            
        } else if (wcscmp(command, PARAM_ADDRESSCHANGE) == 0) {
            LogLevel l = getLOGLevel();
            LOG.setLevel(l);
            notify((const wchar_t **)sources);            
        } else if(wcscmp(command, PARAM_REGISTER) == 0) {            
            WCHAR c_szPath[MAX_PATH];
            getAppName(c_szPath); // /Program files/Funambol/startsync.exe
            LogLevel l = getLOGLevel();
            LOG.setLevel(l);
            hr = PushRouter_RegisterClient(c_szContentType, c_szAppId, c_szPath, c_szParams);
            if (hr == S_OK) {
                LOG.debug("Wap push client registered successfully");
            } else if (hr == PUSHRTR_E_ALREADYREGISTERED) {
                LOG.debug("Wap push client already registered");
            } else {
                LOG.error("Error to register wap push client");
            }
            retValue = NOT_RETURN_TO_MAIN_FORM;
            
        } else if(wcscmp(command, PARAM_DEREGISTER) == 0) {
            //
            // unregister the startsync from the pushrouter
            //
            hr = PushRouter_UnRegisterClient(c_szContentType, c_szAppId);
            LogLevel l = getLOGLevel();
            LOG.setLevel(l);
            if (hr == S_OK) {
                LOG.debug("Wap push client unregistered successfully");
            } else if (hr == PUSHRTR_E_NOTFOUND) {
                LOG.debug("Wap push client not found. Arleady unregistered");
            } else {
                LOG.error("Error to unregister wap push client");
            }
            retValue = NOT_RETURN_TO_MAIN_FORM;
        } else if(wcscmp(command, c_szParams) == 0) {
            LogLevel l = getLOGLevel();
            LOG.setLevel(l);
            memset(&PushMsg, 0, sizeof(PUSHMSG));
            PushMsg.cbSize = sizeof(PUSHMSG);

            hr = PushRouter_Open(c_szContentType, c_szAppId, &hevtMsgAvailable, &hPushRouter);
            if (hr != S_OK) {
                LOG.error("Wap push: PushRouter_Open - it is not possible to register the client.");
            }
            while(WaitForSingleObject(hevtMsgAvailable, 10000) != WAIT_TIMEOUT) {
                hr = PushRouter_GetMessage(hPushRouter, &PushMsg);
                if (hr != S_OK) {
                    LOG.error("Error in PushRouter_GetMessage wap push client");
                    break;
                }
                wchar_t** ss;
                wchar_t** ws = NULL;
                int ret = handleWapPushMessage(&PushMsg, &ws);

                int i = 0;
                int a = 0;
                while(ws[i]){
                    char* srctocmp = toMultibyte(ws[i]);
                    if (!(strcmp(getRegConfig()->getConfigSourcesParameter(srctocmp, "sync"), "none") == 0)){
                        a++;
                    }
                    i++;
                    if (srctocmp){
                        delete [] srctocmp;
                    }
                }

                if(a != 0){
                    ss = new wchar_t*[a+1];

                    i = 0;
                    a = 0;
                    int sizews = 0;
                    while(ws[i]){

                        char* srctocmp = toMultibyte(ws[i]);
                        if (!(strcmp(getRegConfig()->getConfigSourcesParameter(srctocmp, "sync"), "none") == 0)){
                            sizews = wcslen(ws[i])+ 1;
                            ss[a] = new wchar_t[sizews];
                            wcscpy(ss[a], ws[i]);
                            a++;
                        }
                        if ( srctocmp ){
                            delete [] srctocmp;
                        }
                        i++;
                    }
                    ss[a] = 0;
                }
                else{
                    ss = NULL;
                }
                if (ret != 0) {
                    LOG.error("Wap push: error in handleWapPushMessage message");
                    break;
                }
                if (ss) {
                    if (askConfirm(ASK_WAP_PUSH)) {
                        #if _WIN32_WCE > 0x500                
                                                
                        bool found = false;
                        int i = 0;
                        for (i = 0; ss[i]; i++) {
                            if (wcsstr(ss[i], L"mail") != 0) {
                                found = true;
                            }
                        }
                        if (found) {
                             setSourceOnReg(ss);
                             MailSyncMessages(PROVIDER_W, MCF_ACCOUNT_IS_NAME | MCF_RUN_IN_BACKGROUND); 
                             return retValue = NOT_RETURN_TO_MAIN_FORM;                             
                        }                        
                        #endif
                        sync((const wchar_t **)ss);
                    }
                }
                PushRouter_FreeMessage(&PushMsg);
                memset(&PushMsg, 0, sizeof(PUSHMSG));
                PushMsg.cbSize = sizeof(PUSHMSG);                
            }
        } else if (wcscmp(command, PARAM_INCLUSIVE) == 0) {
            
            // just to know the number of ids
            unsigned int i = 0;
            for (i = 0; sources[i]; i++) {
                // the position start from 0 [that is mail, the name of the source]
                // [1], [2].. contains the ids
                //
            }
            // the name of the source: it should be "mail"
            wchar_t* mailSourceName = wstrdup(sources[0]);

            // the buffer for the ids
            const wchar_t ** ids = new const wchar_t*[i];

            for (unsigned j = 0; j < i; j++) {
                ids[j] =  wstrdup(sources[j + 1]);
            }
            delete [] sources;

            sources = new wchar_t* [2];
            sources[0] = mailSourceName;
            sources[1] = 0;
            sync((const wchar_t **)sources, (const wchar_t **)ids);

        } else if (wcscmp(command, PARAM_TRANSPORT) == 0 ||
                   wcscmp(command, PARAM_T_REFRESHSERVER) == 0 ||
                   wcscmp(command, PARAM_T_REFRESHCLIENT ) == 0) {

            if (strcmp(getRegConfig()->getConfigSourcesParameter("mail", "sync"), "none") == 0) {
                int ret = TimedMessageBox(NULL, 
                    getLocalizationUtils()->getLocalizationString(IDS_MAIL_DISABLED),
                    getLocalizationUtils()->getLocalizationString(IDS_FUNAMBOL_ALERT), 
                    MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND, 10 * 1000);
                if(ret == IDYES){
                    getRegConfig()->setConfigSourcesParameter( "mail" , "sync" , "two-way" );
                    getRegConfig()->setDirty(CS_DIRTY_SOURCE_ENABLED);
                    getRegConfig()->saveDirty();
                } else {
                    return 1;
                }
            }
            if( wcscmp(command, PARAM_T_REFRESHSERVER) == 0) {
                if (sources == 0) { //////****************
                    LOG.error("%S call without sources", PARAM_T_REFRESHSERVER);
                    retValue = NOT_RETURN_TO_MAIN_FORM;
                } else {
                    recover("refresh-from-server", (const wchar_t **)sources);
                }

            } else if (wcscmp(command, PARAM_T_REFRESHCLIENT ) == 0) {
                if (sources == 0 ){ //////****************
                    LOG.error("%S call without sources", PARAM_T_REFRESHCLIENT);
                    retValue = NOT_RETURN_TO_MAIN_FORM;
                } else {
                    recover("refresh-from-client", (const wchar_t **)sources);
                }

            } else if (sources) {
                sync((const wchar_t **)sources);

            } else if (!sources) {
                LOG.error("Transport call without sources");
                retValue = 0;
            }
        } else {
            if (!sources) {
                sources = getEnabledSourcesFromConfig();
                if (!sources) {
                    LOG.error("No sources in the config are selected to be synced");                    
                    quit(1);
                }                
            }
            bool flagmail = false;
            for(int i = 0; sources[i]; i++){
                if (wcsicmp(sources[i], TEXT("mail")) == 0){
                    flagmail = true;
                }
            }
            if(!flagmail) {
                if (wcsicmp(command, TEXT("refresh-from-server")) == 0) {
                    if (sources == 0) {
		                quit(1);
	                }
                    recover("refresh-from-server", (const wchar_t **)sources);

                } else if (wcscmp(command, TEXT("refresh-from-client")) == 0) {
                    if (sources == 0) {
		                quit(1);
                    }
                    recover("refresh-from-client", (const wchar_t **)sources);
                } else { // manual parameter
                    sync((const wchar_t **)sources);
                }
            } else {
                if (wcscmp(command, TEXT("refresh-from-server")) == 0 || 
                    wcscmp(command, TEXT("refresh-from-client")) == 0){
                    
                    wstring value = TEXT("transport-");
                    value += command;
                    setValuesInRegistry(TEXT("transportCommand"), value.c_str());
                }
                setSourceOnReg(sources);
                MailSyncMessages(PROVIDER_W, MCF_ACCOUNT_IS_NAME | MCF_RUN_IN_BACKGROUND);
                return retValue = NOT_RETURN_TO_MAIN_FORM;
            }
        }
        if (hPushRouter) {
            PushRouter_Close(hPushRouter);
            PushRouter_FreeMessage(&PushMsg);
        }

        PowerPolicyNotify(PPN_UNATTENDEDMODE, FALSE);

        if (command){
            delete [] command;
        }
        if (sources){
            delete [] sources;
        }

    }//end try
    catch (OutOfMemoryException& e) {

        int k = e.getMemExcErrorCode();
        if (k == -50) {
            LOG.error("Low Storage Memory Exception.");
            quit(k);
        }
        else if (k == -1) { // error due to Out of memory
            LOG.error("Out of memory. Required %lu ", e.getMemExcMemoryRequired());
            quit(-40);
        } else { // error due to Out of memory. Not -1 set but supposed
            LOG.error("Out of memory");
            quit(-40);
        }
    }
    catch (...) {
        LOG.error("Generic failure");
        quit(-2);
    }

    return retValue;
}

void setValuesInRegistry(const wchar_t* name, const wchar_t* value) {
    
    HKEY key;
    DWORD res;
    int sizew = 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;
    }
        
    RegSetValueEx(
        key,
        name,
        NULL,
        REG_SZ,  // we currently support only strings
        (UCHAR*)value,
        (wcslen(value)+1)*sizeof(WCHAR)
        );

    RegFlushKey(key);

finally:

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


/**
* Set a list of sources that has to be synced passing through 
* the SyncMLTransport to take advantage of the mail notification.
* This is done only if the mail source is in the list of sources 
* to be synced
*/
void setSourceOnReg(wchar_t** sources) {
    
    wchar_t* value = NULL;
    int sizew = 0;
   
    for (int i = 0; sources[i]; i++ ){
        sizew += wcslen (sources[i]) + 1;
    }

    value = new wchar_t[sizew];
    
    for (int i = 0; sources[i]; i++ ){
        if (i == 0){
            wcscpy(value, sources[i]);
        } else {
            wcscat(value, TEXT(","));
            wcscat(value, sources[i]);
        }
    }
    
    setValuesInRegistry(TEXT("transportSources"), value);
   
    if (value) {
        delete [] value; value = NULL;
    }
}

/**
* Read the enabled sources from the configuration and return an array null terminated
* with the names of the sources to be synced
*/
wchar_t** getEnabledSourcesFromConfig() {
    
    int i = 0, count = 0;
    wchar_t** sourcesfr = NULL;

    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("mail", "sync"), "none") == 0)) {
        count++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("contact", "sync"), "none") == 0)) {
        count++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("calendar", "sync"), "none") == 0)) {
        count++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("task", "sync"), "none") == 0)) {
        count++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("note", "sync"), "none") == 0)) {
        count++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("briefcase", "sync"), "none") == 0)) {
        count++;
    }
    if (count == 0) {
        return sourcesfr;
    }

    sourcesfr = new wchar_t*[count + 1];                

    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("mail", "sync"), "none") == 0)){
        sourcesfr[i] = wstrdup(TEXT("mail"));
        i++;
    }

    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("contact", "sync"), "none") == 0)){
        sourcesfr[i] = wstrdup(TEXT("contact"));        
        i++;
    }

    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("calendar", "sync"), "none") == 0)){
        sourcesfr[i] = wstrdup(TEXT("calendar"));
        i++;
    }

    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("task", "sync"), "none") == 0)){
        sourcesfr[i] = wstrdup(TEXT("task"));                         
        i++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("note", "sync"), "none") == 0)){
        sourcesfr[i] = wstrdup(TEXT("note"));                          
        i++;
    }
    if(!(strcmp(getRegConfig()->getConfigSourcesParameter("briefcase", "sync"), "none") == 0)){
        sourcesfr[i] = wstrdup(TEXT("briefcase"));  
        i++;
    }
    sourcesfr[i] = 0;
    return sourcesfr;

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美经典一区二区三区| 日韩一区二区三免费高清| 一本在线高清不卡dvd| 在线不卡免费av| 精品视频一区二区不卡| 久久综合国产精品| 亚洲一区二区av在线| 国产成人免费在线| 欧美一级一级性生活免费录像| 欧美网站一区二区| 久久精品一区蜜桃臀影院| 久久久蜜桃精品| 首页欧美精品中文字幕| 首页国产丝袜综合| 91久久精品一区二区二区| 亚洲精品久久嫩草网站秘色| 亚洲激情校园春色| 成人综合婷婷国产精品久久蜜臀 | 偷偷要91色婷婷| av成人免费在线| 中文字幕久久午夜不卡| 国产尤物一区二区在线| 日韩女优视频免费观看| 日韩影院在线观看| 精品一区免费av| 欧美一级片在线看| 久久综合国产精品| 免费看日韩a级影片| 国产精品中文字幕日韩精品| 日韩欧美视频一区| 1000部国产精品成人观看| 国产在线视频精品一区| 精品国产乱码久久久久久老虎| 欧美韩国日本一区| 亚洲成人激情综合网| 国产伦精品一区二区三区免费| 99视频在线精品| 91麻豆精品国产91久久久| 肉肉av福利一精品导航| 东方欧美亚洲色图在线| 国产三级一区二区| 91在线视频网址| 亚洲一区二区三区四区在线| 26uuu另类欧美| 午夜精品影院在线观看| 在线成人免费观看| 亚洲免费观看在线观看| 色国产精品一区在线观看| 亚洲一二三四在线观看| 日韩一级高清毛片| 一区二区三区精品在线| 国产美女久久久久| 日韩一区二区在线观看视频播放| 日本免费新一区视频| 26uuu精品一区二区| 日韩av在线免费观看不卡| 91精品国产色综合久久不卡蜜臀| 天天综合网天天综合色| 国产高清不卡二三区| 色婷婷精品大在线视频| 亚洲综合在线观看视频| 欧美日韩小视频| 蓝色福利精品导航| 久久精品在线观看| 婷婷综合久久一区二区三区| 欧美精品久久99| 九色porny丨国产精品| 国产日韩欧美一区二区三区乱码| 欧美在线观看视频在线| 亚洲午夜电影在线| 国产乱一区二区| 久久久久久久性| 一本到高清视频免费精品| 亚洲一区二区3| 成人禁用看黄a在线| 一区二区三区丝袜| av在线不卡免费看| 亚洲丰满少妇videoshd| 91麻豆精品国产91久久久资源速度 | 精品亚洲国内自在自线福利| 成人久久18免费网站麻豆| 久久综合视频网| 成人精品在线视频观看| 亚洲国产日韩一区二区| 久久综合久久综合久久综合| 日本国产一区二区| 精彩视频一区二区| 亚洲久草在线视频| 精品理论电影在线观看 | 亚洲欧洲99久久| 国内精品伊人久久久久av一坑| 亚洲国产精品成人综合色在线婷婷 | 国产精品蜜臀在线观看| 国产一区二区在线视频| 亚洲午夜在线观看视频在线| 久久女同精品一区二区| 激情深爱一区二区| 亚洲欧洲国产日本综合| 日韩欧美精品在线| 亚洲18色成人| 2021国产精品久久精品| 色哟哟国产精品| 亚洲欧美日韩成人高清在线一区| 不卡的电影网站| 日本美女一区二区三区| 亚洲欧美日韩国产手机在线| 久久一区二区三区四区| 国产91在线观看| 男男gaygay亚洲| 日韩精品资源二区在线| 欧美亚洲国产bt| 成人18精品视频| 亚洲久本草在线中文字幕| 欧美色综合影院| 全国精品久久少妇| 欧美mv和日韩mv的网站| 欧美性大战xxxxx久久久| 亚洲精品美国一| 欧美变态tickling挠脚心| 欧美综合一区二区三区| 五月天激情综合| 亚洲一区电影777| 日韩精品一区二区三区在线观看| 久88久久88久久久| 中文字幕一区二区视频| 久久综合九色综合97_久久久| 国产成人免费视频| 亚洲综合色在线| 91精品国产美女浴室洗澡无遮挡| 91色乱码一区二区三区| 偷拍亚洲欧洲综合| 亚洲国产精品麻豆| 一区二区三区在线高清| ㊣最新国产の精品bt伙计久久| 色综合激情五月| www.在线欧美| 日本成人中文字幕在线视频 | 欧美日韩国产成人在线免费| 色天天综合色天天久久| 国产麻豆视频一区二区| 国产伦精品一区二区三区免费迷| 麻豆精品久久久| 狠狠色2019综合网| 亚洲精品水蜜桃| 精品奇米国产一区二区三区| 日韩欧美国产不卡| 国产免费观看久久| 一区二区三区在线免费播放| 国精产品一区一区三区mba桃花| 久久久不卡网国产精品二区| 91丨porny丨中文| 欧美性猛片xxxx免费看久爱| 国产精品亚洲一区二区三区在线| 粉嫩aⅴ一区二区三区四区五区| 亚洲高清不卡在线观看| 青青国产91久久久久久| 亚洲综合色网站| 中文字幕一区二区三中文字幕| 亚洲精品ww久久久久久p站| 日日摸夜夜添夜夜添国产精品 | 午夜欧美视频在线观看| 日本视频一区二区| a4yy欧美一区二区三区| 欧美日韩精品专区| 久久视频一区二区| 欧美性欧美巨大黑白大战| 日韩欧美国产精品| 欧美电影一区二区| 国产日韩欧美不卡在线| 欧美videos中文字幕| 欧美日韩高清一区| 久久午夜电影网| 亚洲国产精品天堂| 成人精品gif动图一区| 欧美一区二区三区影视| 欧美国产精品中文字幕| 久久精品一区二区三区av| 一区二区三区在线观看视频| 麻豆成人免费电影| 色综合久久综合| 欧美三级中文字| 91精品久久久久久蜜臀| 69堂成人精品免费视频| 中文字幕巨乱亚洲| 丝袜亚洲精品中文字幕一区| 亚洲成人黄色影院| 五月天激情小说综合| 日本三级亚洲精品| 成人精品鲁一区一区二区| 成人教育av在线| 日韩免费高清av| 亚洲一区自拍偷拍| 蓝色福利精品导航| 99久久综合狠狠综合久久| 欧美一区二区视频网站| 欧美电影免费观看完整版| 亚洲一区二区四区蜜桃| 91麻豆免费看| 国产精品毛片无遮挡高清| 亚洲欧美一区二区视频|