\
+
HTTP Error 502.5 - Process Failure
\
+
\
+
\
+
\
+
\
+
\
+
\
+
\
+
")
+ {
+ InitializeSRWLock(&m_srwLock);
+ }
+
+ FILE_WATCHER *m_pFileWatcher;
+ APPLICATION_HASH *m_pApplicationHash;
+ static APPLICATION_MANAGER *sm_pApplicationManager;
+ SRWLOCK m_srwLock;
+ HTTP_DATA_CHUNK *m_pHttp502ErrorPage;
+ LPSTR m_pstrErrorInfo;
+ APP_HOSTING_MODEL m_hostingModel;
+};
\ No newline at end of file
diff --git a/src/AspNetCore/Inc/aspnetcore_event.h b/src/AspNetCore/Inc/aspnetcore_event.h
new file mode 100644
index 0000000000..11f9e248a2
--- /dev/null
+++ b/src/AspNetCore/Inc/aspnetcore_event.h
@@ -0,0 +1,550 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+#ifndef __ASPNETCOREEVENT_H__
+#define __ASPNETCOREEVENT_H__
+/*++
+
+ Module Name:
+
+ aspnetcore_event.h
+
+ Abstract:
+
+ Header file has been generated from mof file containing
+ IIS trace event descriptions
+
+--*/
+
+//
+// Start of the new provider class WWWServerTraceProvider,
+// GUID: {3a2a4e84-4c21-4981-ae10-3fda0d9b0f83}
+// Description: IIS: WWW Server
+//
+
+class WWWServerTraceProvider
+{
+public:
+ static
+ LPCGUID
+ GetProviderGuid( VOID )
+ // return GUID for the current event class
+ {
+ static const GUID ProviderGuid =
+ {0x3a2a4e84,0x4c21,0x4981,{0xae,0x10,0x3f,0xda,0x0d,0x9b,0x0f,0x83}};
+ return &ProviderGuid;
+ };
+ enum enumAreaFlags
+ {
+ // AspNetCore module events
+ ANCM = 0x10000
+ };
+ static
+ LPCWSTR
+ TranslateEnumAreaFlagsToString( enum enumAreaFlags EnumValue)
+ {
+ switch( (DWORD) EnumValue )
+ {
+ case 0x10000: return L"ANCM";
+ }
+ return NULL;
+ };
+
+ static
+ BOOL
+ CheckTracingEnabled(
+ IHttpTraceContext * pHttpTraceContext,
+ enumAreaFlags AreaFlags,
+ DWORD dwVerbosity )
+ {
+ HRESULT hr;
+ HTTP_TRACE_CONFIGURATION TraceConfig;
+ TraceConfig.pProviderGuid = GetProviderGuid();
+ hr = pHttpTraceContext->GetTraceConfiguration( &TraceConfig );
+ if ( FAILED( hr ) || !TraceConfig.fProviderEnabled )
+ {
+ return FALSE;
+ }
+ if ( TraceConfig.dwVerbosity >= dwVerbosity &&
+ ( TraceConfig.dwAreas == (DWORD) AreaFlags ||
+ ( TraceConfig.dwAreas & (DWORD)AreaFlags ) == (DWORD)AreaFlags ) )
+ {
+ return TRUE;
+ }
+ return FALSE;
+ };
+};
+
+//
+// Start of the new event class ANCMEvents,
+// GUID: {82ADEAD7-12B2-4781-BDCA-5A4B6C757191}
+// Description: ANCM runtime events
+//
+
+class ANCMEvents
+{
+public:
+ static
+ LPCGUID
+ GetAreaGuid( VOID )
+ // return GUID for the current event class
+ {
+ static const GUID AreaGuid =
+ {0x82adead7,0x12b2,0x4781,{0xbd,0xca,0x5a,0x4b,0x6c,0x75,0x71,0x91}};
+ return &AreaGuid;
+ };
+
+ //
+ // Event: mof class name ANCMAppStart,
+ // Description: Start application success
+ // EventTypeName: ANCM_START_APPLICATION_SUCCESS
+ // EventType: 1
+ // EventLevel: 4
+ //
+
+ class ANCM_START_APPLICATION_SUCCESS
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId,
+ LPCWSTR pAppDescription
+ )
+ //
+ // Raise ANCM_START_APPLICATION_SUCCESS Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 1;
+ Event.pszEventName = L"ANCM_START_APPLICATION_SUCCESS";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 4;
+ Event.cEventItems = 2;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 2 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Items[ 1 ].pszName = L"AppDescription";
+ Items[ 1 ].dwDataType = HTTP_TRACE_TYPE_LPCWSTR; // mof type (string)
+ Items[ 1 ].pbData = (PBYTE) pAppDescription;
+ Items[ 1 ].cbData =
+ ( Items[ 1 ].pbData == NULL )? 0 : ( sizeof(WCHAR) * (1 + (DWORD) wcslen( (PWSTR) Items[ 1 ].pbData ) ) );
+ Items[ 1 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 4 ); //Verbosity
+ };
+ };
+ //
+ // Event: mof class name ANCMAppStartFail,
+ // Description: Start application failed
+ // EventTypeName: ANCM_START_APPLICATION_FAIL
+ // EventType: 2
+ // EventLevel: 2
+ //
+
+ class ANCM_START_APPLICATION_FAIL
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId,
+ LPCWSTR pFailureDescription
+ )
+ //
+ // Raise ANCM_START_APPLICATION_FAIL Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 2;
+ Event.pszEventName = L"ANCM_START_APPLICATION_FAIL";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 2;
+ Event.cEventItems = 2;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 2 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Items[ 1 ].pszName = L"FailureDescription";
+ Items[ 1 ].dwDataType = HTTP_TRACE_TYPE_LPCWSTR; // mof type (string)
+ Items[ 1 ].pbData = (PBYTE) pFailureDescription;
+ Items[ 1 ].cbData =
+ ( Items[ 1 ].pbData == NULL )? 0 : ( sizeof(WCHAR) * (1 + (DWORD) wcslen( (PWSTR) Items[ 1 ].pbData ) ) );
+ Items[ 1 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 2 ); //Verbosity
+ };
+ };
+ //
+ // Event: mof class name ANCMForwardStart,
+ // Description: Start fardwarding request
+ // EventTypeName: ANCM_REQUEST_FORWARD_START
+ // EventType: 3
+ // EventLevel: 4
+ //
+
+ class ANCM_REQUEST_FORWARD_START
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId
+ )
+ //
+ // Raise ANCM_REQUEST_FORWARD_START Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 3;
+ Event.pszEventName = L"ANCM_REQUEST_FORWARD_START";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 4;
+ Event.cEventItems = 1;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 1 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 4 ); //Verbosity
+ };
+ };
+ //
+ // Event: mof class name ANCMForwardEnd,
+ // Description: Finish forwarding request
+ // EventTypeName: ANCM_REQUEST_FORWARD_END
+ // EventType: 4
+ // EventLevel: 4
+ //
+
+ class ANCM_REQUEST_FORWARD_END
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId
+ )
+ //
+ // Raise ANCM_REQUEST_FORWARD_END Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 4;
+ Event.pszEventName = L"ANCM_REQUEST_FORWARD_END";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 4;
+ Event.cEventItems = 1;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 1 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 4 ); //Verbosity
+ };
+ };
+ //
+ // Event: mof class name ANCMForwardFail,
+ // Description: Forwarding request failure
+ // EventTypeName: ANCM_REQUEST_FORWARD_FAIL
+ // EventType: 5
+ // EventLevel: 2
+ //
+
+ class ANCM_REQUEST_FORWARD_FAIL
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId,
+ ULONG ErrorCode
+ )
+ //
+ // Raise ANCM_REQUEST_FORWARD_FAIL Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 5;
+ Event.pszEventName = L"ANCM_REQUEST_FORWARD_FAIL";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 2;
+ Event.cEventItems = 2;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 2 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Items[ 1 ].pszName = L"ErrorCode";
+ Items[ 1 ].dwDataType = HTTP_TRACE_TYPE_ULONG; // mof type (uint32)
+ Items[ 1 ].pbData = (PBYTE) &ErrorCode;
+ Items[ 1 ].cbData = 4;
+ Items[ 1 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 2 ); //Verbosity
+ };
+ };
+ //
+ // Event: mof class name ANCMWinHttpCallBack,
+ // Description: Receiving callback from WinHttp
+ // EventTypeName: ANCM_WINHTTP_CALLBACK
+ // EventType: 6
+ // EventLevel: 4
+ //
+
+ class ANCM_WINHTTP_CALLBACK
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId,
+ ULONG InternetStatus
+ )
+ //
+ // Raise ANCM_WINHTTP_CALLBACK Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 6;
+ Event.pszEventName = L"ANCM_WINHTTP_CALLBACK";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 4;
+ Event.cEventItems = 2;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 2 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Items[ 1 ].pszName = L"InternetStatus";
+ Items[ 1 ].dwDataType = HTTP_TRACE_TYPE_ULONG; // mof type (uint32)
+ Items[ 1 ].pbData = (PBYTE) &InternetStatus;
+ Items[ 1 ].cbData = 4;
+ Items[ 1 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 4 ); //Verbosity
+ };
+ };
+ //
+ // Event: mof class name ANCMForwardEnd,
+ // Description: Inprocess executing request failure
+ // EventTypeName: ANCM_EXECUTE_REQUEST_FAIL
+ // EventType: 7
+ // EventLevel: 2
+ //
+
+ class ANCM_EXECUTE_REQUEST_FAIL
+ {
+ public:
+ static
+ HRESULT
+ RaiseEvent(
+ IHttpTraceContext * pHttpTraceContext,
+ LPCGUID pContextId,
+ ULONG ErrorCode
+ )
+ //
+ // Raise ANCM_EXECUTE_REQUEST_FAIL Event
+ //
+ {
+ HTTP_TRACE_EVENT Event;
+ Event.pProviderGuid = WWWServerTraceProvider::GetProviderGuid();
+ Event.dwArea = WWWServerTraceProvider::ANCM;
+ Event.pAreaGuid = ANCMEvents::GetAreaGuid();
+ Event.dwEvent = 7;
+ Event.pszEventName = L"ANCM_EXECUTE_REQUEST_FAIL";
+ Event.dwEventVersion = 1;
+ Event.dwVerbosity = 2;
+ Event.cEventItems = 2;
+ Event.pActivityGuid = NULL;
+ Event.pRelatedActivityGuid = NULL;
+ Event.dwTimeStamp = 0;
+ Event.dwFlags = HTTP_TRACE_EVENT_FLAG_STATIC_DESCRIPTIVE_FIELDS;
+
+ // pActivityGuid, pRelatedActivityGuid, Timestamp to be filled in by IIS
+
+ HTTP_TRACE_EVENT_ITEM Items[ 2 ];
+ Items[ 0 ].pszName = L"ContextId";
+ Items[ 0 ].dwDataType = HTTP_TRACE_TYPE_LPCGUID; // mof type (object)
+ Items[ 0 ].pbData = (PBYTE) pContextId;
+ Items[ 0 ].cbData = 16;
+ Items[ 0 ].pszDataDescription = NULL;
+ Items[ 1 ].pszName = L"ErrorCode";
+ Items[ 1 ].dwDataType = HTTP_TRACE_TYPE_ULONG; // mof type (uint32)
+ Items[ 1 ].pbData = (PBYTE) &ErrorCode;
+ Items[ 1 ].cbData = 4;
+ Items[ 1 ].pszDataDescription = NULL;
+ Event.pEventItems = Items;
+ pHttpTraceContext->RaiseTraceEvent( &Event );
+ return S_OK;
+ };
+
+ static
+ BOOL
+ IsEnabled(
+ IHttpTraceContext * pHttpTraceContext )
+ // Check if tracing for this event is enabled
+ {
+ return WWWServerTraceProvider::CheckTracingEnabled(
+ pHttpTraceContext,
+ WWWServerTraceProvider::ANCM,
+ 2 ); //Verbosity
+ };
+ };
+};
+#endif
diff --git a/src/AspNetCore/Inc/aspnetcoreconfig.h b/src/AspNetCore/Inc/aspnetcoreconfig.h
new file mode 100644
index 0000000000..b3fa4d7d8e
--- /dev/null
+++ b/src/AspNetCore/Inc/aspnetcoreconfig.h
@@ -0,0 +1,253 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+#pragma once
+#define CS_ROOTWEB_CONFIG L"MACHINE/WEBROOT/APPHOST/"
+#define CS_ROOTWEB_CONFIG_LEN _countof(CS_ROOTWEB_CONFIG)-1
+#define CS_ASPNETCORE_SECTION L"system.webServer/aspNetCore"
+#define CS_WINDOWS_AUTHENTICATION_SECTION L"system.webServer/security/authentication/windowsAuthentication"
+#define CS_BASIC_AUTHENTICATION_SECTION L"system.webServer/security/authentication/basicAuthentication"
+#define CS_ANONYMOUS_AUTHENTICATION_SECTION L"system.webServer/security/authentication/anonymousAuthentication"
+#define CS_AUTHENTICATION_ENABLED L"enabled"
+#define CS_ASPNETCORE_PROCESS_EXE_PATH L"processPath"
+#define CS_ASPNETCORE_PROCESS_ARGUMENTS L"arguments"
+#define CS_ASPNETCORE_PROCESS_STARTUP_TIME_LIMIT L"startupTimeLimit"
+#define CS_ASPNETCORE_PROCESS_SHUTDOWN_TIME_LIMIT L"shutdownTimeLimit"
+#define CS_ASPNETCORE_WINHTTP_REQUEST_TIMEOUT L"requestTimeout"
+#define CS_ASPNETCORE_RAPID_FAILS_PER_MINUTE L"rapidFailsPerMinute"
+#define CS_ASPNETCORE_STDOUT_LOG_ENABLED L"stdoutLogEnabled"
+#define CS_ASPNETCORE_STDOUT_LOG_FILE L"stdoutLogFile"
+#define CS_ASPNETCORE_ENVIRONMENT_VARIABLES L"environmentVariables"
+#define CS_ASPNETCORE_ENVIRONMENT_VARIABLE L"environmentVariable"
+#define CS_ASPNETCORE_ENVIRONMENT_VARIABLE_NAME L"name"
+#define CS_ASPNETCORE_ENVIRONMENT_VARIABLE_VALUE L"value"
+#define CS_ASPNETCORE_PROCESSES_PER_APPLICATION L"processesPerApplication"
+#define CS_ASPNETCORE_FORWARD_WINDOWS_AUTH_TOKEN L"forwardWindowsAuthToken"
+#define CS_ASPNETCORE_DISABLE_START_UP_ERROR_PAGE L"disableStartUpErrorPage"
+#define CS_ASPNETCORE_RECYCLE_ON_FILE_CHANGE L"recycleOnFileChange"
+#define CS_ASPNETCORE_RECYCLE_ON_FILE_CHANGE_FILE L"file"
+#define CS_ASPNETCORE_RECYCLE_ON_FILE_CHANGE_FILE_PATH L"path"
+#define CS_ASPNETCORE_HOSTING_MODEL L"hostingModel"
+
+#define MAX_RAPID_FAILS_PER_MINUTE 100
+#define MILLISECONDS_IN_ONE_SECOND 1000
+#define MIN_PORT 1025
+#define MAX_PORT 48000
+
+#define HEX_TO_ASCII(c) ((CHAR)(((c) < 10) ? ((c) + '0') : ((c) + 'a' - 10)))
+
+extern HTTP_MODULE_ID g_pModuleId;
+extern IHttpServer * g_pHttpServer;
+extern BOOL g_fRecycleProcessCalled;
+
+enum APP_HOSTING_MODEL
+{
+ HOSTING_UNKNOWN = 0,
+ HOSTING_IN_PROCESS,
+ HOSTING_OUT_PROCESS
+};
+
+class ASPNETCORE_CONFIG : IHttpStoredContext
+{
+public:
+
+ virtual
+ ~ASPNETCORE_CONFIG();
+
+ VOID
+ CleanupStoredContext()
+ {
+ delete this;
+ }
+
+ static
+ HRESULT
+ GetConfig(
+ _In_ IHttpContext *pHttpContext,
+ _Out_ ASPNETCORE_CONFIG **ppAspNetCoreConfig
+ );
+
+ ENVIRONMENT_VAR_HASH*
+ QueryEnvironmentVariables(
+ VOID
+ )
+ {
+ return m_pEnvironmentVariables;
+ }
+
+ DWORD
+ QueryRapidFailsPerMinute(
+ VOID
+ )
+ {
+ return m_dwRapidFailsPerMinute;
+ }
+
+ DWORD
+ QueryStartupTimeLimitInMS(
+ VOID
+ )
+ {
+ return m_dwStartupTimeLimitInMS;
+ }
+
+ DWORD
+ QueryShutdownTimeLimitInMS(
+ VOID
+ )
+ {
+ return m_dwShutdownTimeLimitInMS;
+ }
+
+ DWORD
+ QueryProcessesPerApplication(
+ VOID
+ )
+ {
+ return m_dwProcessesPerApplication;
+ }
+
+ DWORD
+ QueryRequestTimeoutInMS(
+ VOID
+ )
+ {
+ return m_dwRequestTimeoutInMS;
+ }
+
+ STRU*
+ QueryArguments(
+ VOID
+ )
+ {
+ return &m_struArguments;
+ }
+
+ STRU*
+ QueryApplicationPath(
+ VOID
+ )
+ {
+ return &m_struApplication;
+ }
+
+ STRU*
+ QueryApplicationFullPath(
+ VOID
+ )
+ {
+ return &m_struApplicationFullPath;
+ }
+
+ STRU*
+ QueryApplicationVirtualPath(
+ VOID
+ )
+ {
+ return &m_struApplicationVirtualPath;
+ }
+
+ STRU*
+ QueryProcessPath(
+ VOID
+ )
+ {
+ return &m_struProcessPath;
+ }
+
+ APP_HOSTING_MODEL
+ QueryHostingModel(
+ VOID
+ )
+ {
+ return m_hostingModel;
+ }
+
+ STRU*
+ QueryHostingModelStr(
+ VOID
+ )
+ {
+ return &m_strHostingModel;
+ }
+
+ BOOL
+ QueryStdoutLogEnabled()
+ {
+ return m_fStdoutLogEnabled;
+ }
+
+ BOOL
+ QueryForwardWindowsAuthToken()
+ {
+ return m_fForwardWindowsAuthToken;
+ }
+
+ BOOL
+ QueryWindowsAuthEnabled()
+ {
+ return m_fWindowsAuthEnabled;
+ }
+
+ BOOL
+ QueryBasicAuthEnabled()
+ {
+ return m_fBasicAuthEnabled;
+ }
+
+ BOOL
+ QueryAnonymousAuthEnabled()
+ {
+ return m_fAnonymousAuthEnabled;
+ }
+
+ BOOL
+ QueryDisableStartUpErrorPage()
+ {
+ return m_fDisableStartUpErrorPage;
+ }
+
+ STRU*
+ QueryStdoutLogFile()
+ {
+ return &m_struStdoutLogFile;
+ }
+
+private:
+
+ //
+ // private constructor
+ //
+ ASPNETCORE_CONFIG():
+ m_fStdoutLogEnabled( FALSE ),
+ m_pEnvironmentVariables( NULL ),
+ m_hostingModel( HOSTING_UNKNOWN )
+ {
+ }
+
+ HRESULT
+ Populate(
+ IHttpContext *pHttpContext
+ );
+
+ DWORD m_dwRequestTimeoutInMS;
+ DWORD m_dwStartupTimeLimitInMS;
+ DWORD m_dwShutdownTimeLimitInMS;
+ DWORD m_dwRapidFailsPerMinute;
+ DWORD m_dwProcessesPerApplication;
+ STRU m_struApplication;
+ STRU m_struArguments;
+ STRU m_struProcessPath;
+ STRU m_struStdoutLogFile;
+ STRU m_struApplicationFullPath;
+ STRU m_strHostingModel;
+ STRU m_struApplicationVirtualPath;
+ BOOL m_fStdoutLogEnabled;
+ BOOL m_fForwardWindowsAuthToken;
+ BOOL m_fDisableStartUpErrorPage;
+ BOOL m_fWindowsAuthEnabled;
+ BOOL m_fBasicAuthEnabled;
+ BOOL m_fAnonymousAuthEnabled;
+ APP_HOSTING_MODEL m_hostingModel;
+ ENVIRONMENT_VAR_HASH* m_pEnvironmentVariables;
+};
diff --git a/src/AspNetCore/Inc/bldver.h b/src/AspNetCore/Inc/bldver.h
new file mode 100644
index 0000000000..25648cf819
--- /dev/null
+++ b/src/AspNetCore/Inc/bldver.h
@@ -0,0 +1,61 @@
+//
+// this file is automatically generated
+// by beaver.exe 1.11.2003.0
+//
+
+//
+// if you want to use a private version file and customize this, see
+// file://samsndrop02/CoreXT-Latest/docs/corext/corext/version.htm
+//
+
+#ifndef _BLDVER_H_
+#define _BLDVER_H_
+
+#define BUILD_NUMBER "1965.0"
+#define BUILD_NUM 1965,0
+#define PRODUCT_NUMBER "7.1"
+#define PRODUCT_NUM 7,1
+#define INET_VERSION "7.1.1965.0"
+#define INET_VERSION_L L"7.1.1965.0"
+#define INET_VER 7,1,1965,0
+
+#define PRODUCT_MAJOR 7
+#define PRODUCT_MAJOR_STRING "7"
+#define PRODUCT_MAJOR_NUMBER 7
+
+#define PRODUCT_MINOR 1
+#define PRODUCT_MINOR_STRING "1"
+#define PRODUCT_MINOR_NUMBER 1
+
+#define BUILD_MAJOR 1965
+#define BUILD_MAJOR_STRING "1965"
+#define BUILD_MAJOR_NUMBER 1965
+
+#define BUILD_MINOR 0
+#define BUILD_MINOR_STRING "0"
+#define BUILD_MINOR_NUMBER 0
+
+#define BUILD_PRIVATE "Built by panwang on IIS-OOB.\0"
+
+// beaver.exe can't handle a pragma to disable redefinition
+#undef VER_PRODUCTVERSION
+#undef VER_PRODUCTVERSION_STR
+#undef VER_PRODUCTMAJORVERSION
+#undef VER_PRODUCTMINORVERSION
+#undef VER_PRODUCTBUILD
+#undef VER_PRODUCTBUILD_QFE
+#undef VER_PRODUCTNAME_STR
+#undef VER_COMPANYNAME_STR
+
+#define VER_PRODUCTVERSION 7,1,1965,0
+#define VER_PRODUCTVERSION_STR 7.1.1965.0
+#define VER_PRODUCTMAJORVERSION 7
+#define VER_PRODUCTMINORVERSION 1
+#define VER_PRODUCTBUILD 1965
+#define VER_PRODUCTBUILD_QFE 0
+#define VER_PRODUCTNAME_STR "Microsoft Web Platform Extensions"
+#define VER_COMPANYNAME_STR "Microsoft Corporation"
+
+
+
+#endif
diff --git a/src/AspNetCore/Inc/debugutil.h b/src/AspNetCore/Inc/debugutil.h
new file mode 100644
index 0000000000..aee17b4fba
--- /dev/null
+++ b/src/AspNetCore/Inc/debugutil.h
@@ -0,0 +1,82 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+#pragma once
+
+#define ASPNETCORE_DEBUG_FLAG_INFO 0x00000001
+#define ASPNETCORE_DEBUG_FLAG_WARNING 0x00000002
+#define ASPNETCORE_DEBUG_FLAG_ERROR 0x00000004
+
+extern DWORD g_dwAspNetCoreDebugFlags;
+
+static
+BOOL
+IfDebug(
+ DWORD dwFlag
+ )
+{
+ return ( dwFlag & g_dwAspNetCoreDebugFlags );
+}
+
+static
+VOID
+DebugPrint(
+ DWORD dwFlag,
+ LPCSTR szString
+ )
+{
+ STACK_STRA (strOutput, 256);
+ HRESULT hr = S_OK;
+
+ if ( IfDebug( dwFlag ) )
+ {
+ hr = strOutput.SafeSnprintf(
+ "[aspnetcore.dll] %s\r\n",
+ szString );
+
+ if (FAILED (hr))
+ {
+ goto Finished;
+ }
+
+ OutputDebugStringA( strOutput.QueryStr() );
+ }
+
+Finished:
+
+ return;
+}
+
+static
+VOID
+DebugPrintf(
+DWORD dwFlag,
+LPCSTR szFormat,
+...
+)
+{
+ STACK_STRA (strCooked,256);
+
+ va_list args;
+ HRESULT hr = S_OK;
+
+ if ( IfDebug( dwFlag ) )
+ {
+ va_start( args, szFormat );
+
+ hr = strCooked.SafeVsnprintf(szFormat, args );
+
+ va_end( args );
+
+ if (FAILED (hr))
+ {
+ goto Finished;
+ }
+
+ DebugPrint( dwFlag, strCooked.QueryStr() );
+ }
+
+Finished:
+ return;
+}
+
diff --git a/src/AspNetCore/Inc/environmentvariablehash.h b/src/AspNetCore/Inc/environmentvariablehash.h
new file mode 100644
index 0000000000..797c63c21c
--- /dev/null
+++ b/src/AspNetCore/Inc/environmentvariablehash.h
@@ -0,0 +1,155 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+#pragma once
+
+//
+// The key used for hash-table lookups, consists of the port on which the http process is created.
+//
+
+class ENVIRONMENT_VAR_ENTRY
+{
+public:
+ ENVIRONMENT_VAR_ENTRY():
+ _cRefs(1)
+ {
+ }
+
+ HRESULT
+ Initialize(
+ PCWSTR pszName,
+ PCWSTR pszValue
+ )
+ {
+ HRESULT hr = S_OK;
+ if (FAILED(hr = _strName.Copy(pszName)) ||
+ FAILED(hr = _strValue.Copy(pszValue)))
+ {
+ }
+ return hr;
+ }
+
+ VOID
+ Reference() const
+ {
+ InterlockedIncrement(&_cRefs);
+ }
+
+ VOID
+ Dereference() const
+ {
+ if (InterlockedDecrement(&_cRefs) == 0)
+ {
+ delete this;
+ }
+ }
+
+ PWSTR const
+ QueryName()
+ {
+ return _strName.QueryStr();
+ }
+
+ PWSTR const
+ QueryValue()
+ {
+ return _strValue.QueryStr();
+ }
+
+private:
+ ~ENVIRONMENT_VAR_ENTRY()
+ {
+ }
+
+ STRU _strName;
+ STRU _strValue;
+ mutable LONG _cRefs;
+};
+
+class ENVIRONMENT_VAR_HASH : public HASH_TABLE