/*++ Copyright (c) 1998-2002 Microsoft Corporation. All rights reserved. --*/ #ifndef WEB_EXE_BLOCK_FILTER_IMPL_H_ #define WEB_EXE_BLOCK_FILTER_IMPL_H_ class CWebExeBlockFilterImpl { public: CWebExeBlockFilterImpl(); virtual ~CWebExeBlockFilterImpl(); DWORD OnReceiveResponseRawData( PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_RAW_DATA pRawData ); DWORD OnEndOfRequest( PHTTP_FILTER_CONTEXT pfc ); HRESULT Init(); HRESULT Reload(); HRESULT Shutdown(); private: DWORD DisableResponseRawDataNotification( PHTTP_FILTER_CONTEXT pfc ); BOOL FindEndOfHeaders( const char* pszData, const DWORD dwDataLen, DWORD* pdwHeadersLen ); DWORD GetContentLength( const char* pszHeaders, char* pszHeadersEnd ); DWORD GetHttpStatus( const char* pszHeaders, const char* pszHeadersEnd, DWORD* pdwHttpStatus ); }; class CWebExeBlockRequestContext { friend CWebExeBlockFilterImpl; public: CWebExeBlockRequestContext() : m_pszRawData(NULL), m_dwRawDataLength(0), m_fFinishedReceivingHeaders(FALSE), m_pszBody(NULL), m_dwBodyLength(0), m_dwContentLength(0) { } ~CWebExeBlockRequestContext() { // // no need to delete the old memory, since it will be freed by the proxy at the // end of this request. // m_pszRawData = NULL; m_dwRawDataLength = 0; // m_pszBody always points somewhere inside m_pszRawData, so we don't need to delete it. } private: char* m_pszRawData; DWORD m_dwRawDataLength; BOOL m_fFinishedReceivingHeaders; char* m_pszBody; DWORD m_dwBodyLength; DWORD m_dwContentLength; }; #endif // WEB_EXE_BLOCK_FILTER_IMPL_H_