📄 exchangerequest.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#ifndef _EXCHANGEREQUEST_H_181736402_ // To prevent multiple #includes
#define _EXCHANGEREQUEST_H_181736402_
#include "IExchangeClient.h"
#include "Includes.h"
#include "XMLDataRecordParser.h"
class CExchangeClient;
class IExchangeClientFormatHandler;
class CXMLDataRecordParser;
interface IXMLHTTPRequest;
//implementation
class CExchangeClientRequest :
public CComObjectRootEx<CComMultiThreadModel>,
public IExchangeClientRequest
{
public:
CExchangeClientRequest();
virtual ~CExchangeClientRequest();
public:
DECLARE_NO_REGISTRY()
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CExchangeClientRequest)
COM_INTERFACE_ENTRY(IExchangeClientRequest)
END_COM_MAP()
public:
virtual HRESULT STDMETHODCALLTYPE GetStatus(
ExchangeClientRequestStatus *pStatus
);
virtual HRESULT STDMETHODCALLTYPE GetType(
ExchangeClientRequestType *pType
);
virtual HRESULT STDMETHODCALLTYPE GetDataItemArray(
IExchangeClientDataItemArray **ppiArray
);
virtual HRESULT STDMETHODCALLTYPE GetHttpStatus(
LONG *plHttpStatus
);
virtual HRESULT STDMETHODCALLTYPE Cancel();
public:
HRESULT Initialize(
CExchangeClient *pClient,
IExchangeClientFormatHandler *piFormatHandler,
ExchangeClientRequestType ecrt
);
HRESULT Process(
IXMLHTTPRequest * piHttpRequest,
CXMLDataRecordParser * pParser
);
public:
HRESULT UpdateStatus (ExchangeClientRequestStatus status );
private:
BOOL ResponseIsOWALoginPage(
IXMLHTTPRequest * piHttpRequest
);
HRESULT SendRequest(
IXMLHTTPRequest * piHttpRequest
);
HRESULT BypassOWALoginPageAndResend(
IXMLHTTPRequest *piHttpRequest,
BSTR bstrServername,
BSTR bstrUsername,
BSTR bstrPassword
);
HRESULT SetType (ExchangeClientRequestType type );
HRESULT SetHttpStatus(LONG lStatus);
private:
BOOL Canceled() { return InterlockedCompareExchange(&m_fCanceled, TRUE, TRUE); }
private:
LONG m_lHttpStatus;
LONG m_fCanceled;
ExchangeClientRequestStatus m_Status;
ExchangeClientRequestType m_Type;
RefCountedDataRecordList *m_pDataRecordList;
CExchangeClient *m_pClient;
IExchangeClientFormatHandler *m_piFormatHandler;
};
#endif // !defined _EXCHANGEREQUEST_H_181736402_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -