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

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

?? exchangeclient.cpp

?? 一個WinCE6。0下的IP phone的源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
    CExchangeClient::OnWorkerThreadTermination
    
    Epilogue for the worker thread - notifies callback interface of 
    client termination
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::OnWorkerThreadTermination()
{
    PostMessage(m_hwndCallback, ECM_WORKER_THREAD_TERMINATED, 0, 0);
    return S_OK;
}
/*------------------------------------------------------------------------------
    CExchangeClient::WorkerThreadProc
    
    The thread proc for the worker thread - 

    Receives a request from the request queue and processes it - if there are no requests, 
    waits for a new request or the app to signal the thread to exit.
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::WorkerThreadProc()
{
    TRACE();
    CExchangeClientRequest *pRequest = NULL;
    BOOL                    fExit    = FALSE;

    while (!fExit)
    {
        //First see if we were signaled to exit - otherwise process next request
        if (WaitForSingleObject(m_hEventExit, 0) == WAIT_OBJECT_0)
        {
            fExit = TRUE;
            break;
        }
        
        //Get the next request from the queue (if it exists)
        HRESULT hr = GetNextRequest(&pRequest);

        //hr == S_OK if there is a pending request
        if (hr == S_OK)
        {
            SetCurrentRequest(pRequest);
            //Tell the request to process itself, with our XMLHttpRequest and Parser
            hr = pRequest->Process(
                m_cpHttpRequest,
                &m_DataRecordParser
                );
            SetCurrentRequest(NULL);
        }

        //hr == S_FALSE if there are no requests in the queue
        //in this case we should sleep!
        else if (hr == S_FALSE)
        {
            HANDLE  rghWait[] = { m_hEventExit, m_hEventNewRequest };

            DWORD   dwWaitResult = WaitForMultipleObjects(
                ARRAYSIZE(rghWait),
                rghWait,
                FALSE,
                INFINITE
                );

            if (dwWaitResult == WAIT_FAILED)
            {
                ASSERT(FALSE);
                continue;
            }

            //Determine which event was fired - 
            HANDLE  hEventFired = rghWait[dwWaitResult - WAIT_OBJECT_0];

            //Uninitialize has been called - terminate the thread
            if (hEventFired == m_hEventExit)
            {
                fExit = TRUE;
                break;
            }
            //There is a new request in the queue - reset the event and reloop!
            else if (hEventFired == m_hEventNewRequest)
            {
                ResetEvent(m_hEventNewRequest);
                continue;
            }
        }

        //Free the request that was just popped off the queue
        SafeRelease(pRequest);
    }
    
    return S_OK;
}

/*------------------------------------------------------------------------------
    CExchangeClient::GetNextRequest
    
    Synchrnonous method for popping the head of the queue

    Returns: S_OK if there are items in the queue
             S_FALSE if no items in the queue
------------------------------------------------------------------------------*/
HRESULT     CExchangeClient::GetNextRequest(CExchangeClientRequest **ppRequest)
{
    TRACE();
    HRESULT     hr = S_OK;

    //Check params
    if (ppRequest == NULL)
    {
        ASSERT(FALSE);
        return E_POINTER;
    }

    *ppRequest = NULL;

    //Synchronize access to the queue
    LockRequests();
    
    if (m_queuePendingRequests.size() > 0)
    {
        *ppRequest = m_queuePendingRequests.front();
        m_queuePendingRequests.pop_front();
    }
    else
    {
        hr = S_FALSE;
    }
    
    //release the queue lock
    UnlockRequests();

    return hr;        
}

/*------------------------------------------------------------------------------
    CExchangeClient::AddNewRequest
    
    Synchronously adds a new request to the queue and signals the worker thread
------------------------------------------------------------------------------*/
HRESULT     CExchangeClient::AddNewRequest(CExchangeClientRequest *pRequest)
{
    TRACE();

    //Check params
    if (pRequest == NULL)
    {
        ASSERT(FALSE);
        return E_POINTER;
    }

    HRESULT hr = S_OK;

    //syncronize access to the queue
    LockRequests();
    
    if (! m_queuePendingRequests.push_back(pRequest))
    {
        hr = E_OUTOFMEMORY;
    }
    else
    {
        //Add a reference to the object that we placed in the queue
        pRequest->AddRef();
        
        //Signal the worker thread
        SetEvent(m_hEventNewRequest);
    }

    //release the queue lock
    UnlockRequests();

    return hr;
}

/*------------------------------------------------------------------------------
    CExchangeClient::CancelCurrentRequest
    
    Cancels the current request (if a request is currently running)
------------------------------------------------------------------------------*/
VOID CExchangeClient::CancelCurrentRequest()
{
    LockRequests();
    if (m_cpCurrentRequest != NULL)
    {
        m_cpCurrentRequest->Cancel();
    }
    UnlockRequests();
}

/*------------------------------------------------------------------------------
    CExchangeClient::SetCurrentRequest
    
    Syncronously Sets the current request
------------------------------------------------------------------------------*/
VOID CExchangeClient::SetCurrentRequest(IExchangeClientRequest * piRequest)
{
    LockRequests();
    m_cpCurrentRequest = piRequest;
    UnlockRequests();
}

/*------------------------------------------------------------------------------
    CExchangeClient::SetCredentials
    
    Set the username/password of the user
------------------------------------------------------------------------------*/
HRESULT STDMETHODCALLTYPE   CExchangeClient::SetCredentials(
    const WCHAR * c_wszUsername, 
    const WCHAR * c_wszPassword
    )
{
    //check params
    if (!m_fInitialized)
    {
        return OWAEC_E_NOTINITIALIZED;
    }

    //check params
    if (c_wszUsername == NULL || c_wszPassword == NULL)
    {
        return E_POINTER;
    }

    HRESULT hr                        = S_OK;
    WCHAR   wszUsernameCopy[MAX_PATH] = L"";
    WCHAR  *pwchUsername              = NULL,
           *pwchDomain                = NULL;
    
    StringCchCopy(wszUsernameCopy, _countof(wszUsernameCopy), c_wszUsername);

    //break the username into a domain and a username
    WCHAR *pwchDomainUsernameSeparator = wcschr(wszUsernameCopy, L'\\');
    if (pwchDomainUsernameSeparator != NULL)
    {
        pwchDomain = (WCHAR*)wszUsernameCopy;
        
        *pwchDomainUsernameSeparator = 0;
        pwchDomainUsernameSeparator++;

        pwchUsername = pwchDomainUsernameSeparator;
    }
    else
    {
        //point the domain to the null-character at the end
        pwchDomain   = wszUsernameCopy + wcslen(wszUsernameCopy);
        pwchUsername = (WCHAR*)wszUsernameCopy;
    }
    
    hr = WriteCredentials(
        pwchDomain, 
        pwchUsername, 
        c_wszPassword
        );

    if (SUCCEEDED(hr))
    {
        //Cancel all requests so that all future requests use new credentials
        CancelPendingRequests();
        CancelCurrentRequest();

        //Remake the http request to remove the credential cookies
        hr = RecreateXMLHttpObject();
    }    

    return hr;
}

/*------------------------------------------------------------------------------
    CExchangeClient::SetServer
    
    Set the address of the exchange server
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::SetServer(
    const WCHAR * c_wszServername
    )
{
    //check params
    if (!m_fInitialized)
    {
        return OWAEC_E_NOTINITIALIZED;
    }

    if (c_wszServername == NULL)
    {
        return E_POINTER;
    }

    //Cancel all requests so that all requests use the new servername
    CancelPendingRequests();
    CancelCurrentRequest();
    
    //clear out the old value
    m_wstrServer.clear();
    
    //Chop off the ending '/' (if it exists)
    INT cchServerName = wcslen(c_wszServername);
    if (c_wszServername[cchServerName - 1] == L'/')
    {
        cchServerName--;
    }

    //assign the member var with the ending '/' removed (if there)
    if (!m_wstrServer.assign(c_wszServername, cchServerName))
    {
        return E_OUTOFMEMORY;
    }

    return S_OK;
}

/*------------------------------------------------------------------------------
    CExchangeClient::GetServer
    
    Get the server that is currently set in this instance
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::GetServer(
    WCHAR * wszBuffer, 
    UINT cchBuffer
    )
{
    if (!m_fInitialized)
    {
        return OWAEC_E_NOTINITIALIZED;
    }

    if (wszBuffer == NULL)
    {
        return E_POINTER;
    }

    if (cchBuffer == 0)
    {
        return E_INVALIDARG;
    }

    StringCchCopy(wszBuffer, cchBuffer, m_wstrServer.get_buffer());
    
    return S_OK;
    
}
/*------------------------------------------------------------------------------
    CExchangeClient::Uninitialize
    
    Notifies the worker thread to exit
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::Uninitialize()
{
    TRACE();
    //Check that we are still initialized
    if (!m_fInitialized)
    {
        return OWAEC_E_NOTINITIALIZED;
    }

    //cancel all the requests so we can cleanly exit.
    CancelPendingRequests();
    CancelCurrentRequest();
    
    m_fInitialized = FALSE;
    SetEvent(m_hEventExit);
    return S_OK;
}

/*------------------------------------------------------------------------------
    CExchangeClient::RequestContacts
    
    Asyncronously gets the contacts for the registered user. Results are posted on 
    the main thread to the callback interface    
    
    Parameters:
        IN  ContactsSearchCriteria to filter contacts by - can be NULL or empty
        OUT IExchangeClientRequest that can be used to track the request
    
    Returns (HRESULT): Indicating whether the request has successfully started
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::RequestContacts(
    ContactsSearchCriteria   *pCriteria,
    IExchangeClientRequest  **ppiRequest
    )
{
    TRACE();
    HRESULT                       hr              = S_OK;
    CContactsFormatHandler       *pHandler        = NULL;

    if (!m_fInitialized)
    {
        return OWAEC_E_NOTINITIALIZED;
    }

    if (pCriteria == NULL)
    {
        return E_POINTER;
    }
    
    pHandler = new CContactsFormatHandler;
    if (pHandler == NULL)
    {
        hr = E_OUTOFMEMORY;
    }

    if (SUCCEEDED(hr))
    {
        //Dispatch the request  
        hr = DispatchRequest(
            e_ecrtContacts,
            reinterpret_cast<VOID*>(pCriteria),
            reinterpret_cast<IExchangeClientFormatHandler*>(pHandler),
            ppiRequest
            );
    }

    SafeRelease(pHandler);
    return hr;
}

/*------------------------------------------------------------------------------
    CExchangeClient::RequestGALSearch
    
    Asyncronously searchs the GAL with the specified parameters. Results are posted on 
    the main thread to the callback interface    
    
    Parameters:
        OUT IExchangeClientRequest that can be used to track the request
    
    Returns (HRESULT): Indicating whether the request has successfully started
------------------------------------------------------------------------------*/
HRESULT CExchangeClient::RequestGALSearch(
    GALSearchCriteria * pCriteria, 
    IExchangeClientRequest * * ppiRequest
    )
{
    HRESULT                       hr       = S_OK;
    CGALSearchFormatHandler      *pHandler = NULL;

    if (!m_fInitialized)
    {
        return OWAEC_E_NOTINITIALIZED;
    }

    //Check parameters
    if (pCriteria == NULL)
    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产人成亚洲第一网站在线播放 | 美女在线视频一区| 欧美α欧美αv大片| 99国产精品久久久久久久久久| 亚洲一区二区三区四区在线免费观看| 久久女同互慰一区二区三区| 欧美性受xxxx黑人xyx| 国产不卡免费视频| 日韩精品欧美成人高清一区二区| 国产精品超碰97尤物18| 精品毛片乱码1区2区3区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久99国产精品尤物| 亚洲成人在线网站| 一级日本不卡的影视| 国产日韩在线不卡| 亚洲精品在线免费播放| 欧美福利一区二区| 91美女片黄在线| 成人黄色av电影| 国产精品2024| 美女国产一区二区| 亚洲午夜精品在线| 夜夜精品浪潮av一区二区三区| 中文一区一区三区高中清不卡| 久久众筹精品私拍模特| 精品三级av在线| 欧美乱妇一区二区三区不卡视频| 欧美日韩综合不卡| 欧美三级韩国三级日本一级| 91麻豆精品在线观看| 成人午夜视频在线| 国产很黄免费观看久久| 91偷拍与自偷拍精品| 成人永久看片免费视频天堂| 国产一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 99精品在线免费| 菠萝蜜视频在线观看一区| 成人激情校园春色| 北条麻妃一区二区三区| 99久久精品国产一区二区三区| 成人黄页在线观看| 一本高清dvd不卡在线观看| 91在线视频播放地址| 色综合色综合色综合色综合色综合| 91老师片黄在线观看| 欧美亚洲综合久久| 欧美精选午夜久久久乱码6080| 欧美精品少妇一区二区三区| 91精品国产综合久久精品app| 欧美精品v日韩精品v韩国精品v| 91精品国产91久久久久久一区二区 | 夜夜嗨av一区二区三区| 亚洲午夜激情av| 日韩国产高清在线| 激情综合色丁香一区二区| 激情小说欧美图片| 成人禁用看黄a在线| 色婷婷国产精品综合在线观看| 日本黄色一区二区| 91精品国产一区二区三区蜜臀| 日韩免费视频线观看| 国产日产欧美一区| 亚洲人成在线播放网站岛国 | 奇米色777欧美一区二区| 精品在线观看免费| va亚洲va日韩不卡在线观看| 精品久久99ma| 国产欧美日本一区二区三区| 亚洲精品视频在线观看免费 | 久久精品国产色蜜蜜麻豆| 岛国精品在线播放| 欧美亚洲丝袜传媒另类| 精品人在线二区三区| 国产精品久久久久三级| 亚洲v日本v欧美v久久精品| 精品在线免费观看| 色88888久久久久久影院野外| 91精品国产麻豆国产自产在线| 久久综合国产精品| 亚洲一区在线电影| 国产一区二区福利| 在线一区二区三区做爰视频网站| 欧美一级片在线看| 国产精品理论片| 性久久久久久久久| 懂色av一区二区三区免费观看| 色综合一个色综合| 26uuu另类欧美| 亚洲一区二区五区| 国产精品影视在线| 欧美高清视频一二三区| 1区2区3区欧美| 国内久久婷婷综合| 欧美日韩国产高清一区二区| 国产精品美女久久久久久| 视频一区二区中文字幕| jizzjizzjizz欧美| 精品国精品国产尤物美女| 亚洲成人一区在线| a级高清视频欧美日韩| 久久综合久久鬼色| 日韩专区中文字幕一区二区| 成人激情免费视频| 久久久欧美精品sm网站| 日本va欧美va瓶| 色八戒一区二区三区| 国产亚洲短视频| 久久机这里只有精品| 欧美乱妇15p| 亚洲精品免费在线播放| 国产成人精品亚洲午夜麻豆| 中文字幕日韩av资源站| 国产一区二区三区不卡在线观看 | 成人av午夜影院| 欧美成人激情免费网| 亚洲国产成人高清精品| www.性欧美| 中文字幕 久热精品 视频在线 | 一区二区三区国产精华| 国产91综合一区在线观看| 精品国内片67194| 精品一区二区影视| 日韩视频一区二区三区在线播放| 亚洲综合网站在线观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 精品久久久久久最新网址| 婷婷激情综合网| 91福利国产成人精品照片| 亚洲男同1069视频| 99精品欧美一区二区三区小说 | 久久成人久久鬼色| 3d成人h动漫网站入口| 五月开心婷婷久久| 制服丝袜中文字幕亚洲| 午夜电影网亚洲视频| 欧美色综合网站| 午夜久久福利影院| 91精品国产综合久久久久久久| 天天射综合影视| 欧美一区二区三区视频免费 | 一本色道久久综合亚洲精品按摩| 亚洲男同1069视频| 欧美羞羞免费网站| 天堂成人国产精品一区| 欧美一区二区三区四区久久| 麻豆精品蜜桃视频网站| 久久久久国产精品麻豆| 成人午夜av电影| 亚洲女与黑人做爰| 精品视频一区二区不卡| 免费视频一区二区| 久久久久久久精| aaa欧美大片| 亚洲成在人线免费| 精品国产区一区| 国产不卡视频在线播放| 亚洲色图欧洲色图| 欧美日韩亚州综合| 蜜臂av日日欢夜夜爽一区| 久久久91精品国产一区二区精品 | 精品国产污网站| 不卡电影一区二区三区| 亚洲自拍偷拍av| 日韩情涩欧美日韩视频| 粉嫩绯色av一区二区在线观看| 亚洲免费观看高清| 91精品国产色综合久久不卡电影| 精一区二区三区| 成人免费在线视频观看| 欧美性色综合网| 国产一区二区影院| 亚洲免费av网站| 欧美精品一区二区在线播放| 91麻豆精品视频| 理论电影国产精品| 亚洲另类色综合网站| 日韩欧美久久久| 91麻豆免费观看| 国产在线精品一区在线观看麻豆| 亚洲精品成a人| 2017欧美狠狠色| 在线观看日韩高清av| 精品亚洲成a人| 一区二区三区四区五区视频在线观看 | 国产精品一品视频| 亚洲六月丁香色婷婷综合久久| 日韩欧美一区二区视频| 91麻豆国产福利在线观看| 久久国产欧美日韩精品| 亚洲色图丝袜美腿| 精品国产一区a| 欧美日韩一区三区| jlzzjlzz亚洲日本少妇| 另类小说一区二区三区| 亚洲gay无套男同| 一色桃子久久精品亚洲| 久久先锋影音av鲁色资源网| 欧美天堂一区二区三区|