Merging IIS and nginx code into M2 trunk.

This commit is contained in:
gregwroblewski
2012-08-20 08:18:11 +00:00
parent 8d5131a186
commit f3e31c75a4
56 changed files with 16914 additions and 0 deletions

65
iis/mymodulefactory.h Normal file
View File

@@ -0,0 +1,65 @@
#ifndef __MODULE_FACTORY_H__
#define __MODULE_FACTORY_H__
// Factory class for CMyHttpModule.
// This class is responsible for creating instances
// of CMyHttpModule for each request.
class CMyHttpModuleFactory : public IHttpModuleFactory
{
CMyHttpModule * m_pModule;
public:
CMyHttpModuleFactory()
{
m_pModule = NULL;
}
virtual
HRESULT
GetHttpModule(
OUT CHttpModule **ppModule,
IN IModuleAllocator *
)
{
HRESULT hr = S_OK;
if ( ppModule == NULL )
{
hr = HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER );
goto Finished;
}
if(m_pModule == NULL)
{
m_pModule = new CMyHttpModule();
if ( m_pModule == NULL )
{
hr = HRESULT_FROM_WIN32( ERROR_NOT_ENOUGH_MEMORY );
goto Finished;
}
}
*ppModule = m_pModule;
Finished:
return hr;
}
virtual
void
Terminate()
{
if ( m_pModule != NULL )
{
//m_pModule->WriteEventViewerLog("Module terminated.");
delete m_pModule;
m_pModule = NULL;
}
delete this;
}
};
#endif