Reenable precompiled headers in AspNetCore project (#937)

This commit is contained in:
Pavel Krymets 2018-06-21 11:32:56 -07:00 committed by GitHub
parent d7bcb19c79
commit 93de3f83ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 120 additions and 116 deletions

View File

@ -76,7 +76,6 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ASPNETCOREMODULE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -98,6 +97,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>precomp.hxx</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -112,7 +112,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ASPNETCOREMODULE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@ -134,6 +133,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<IntrinsicFunctions>true</IntrinsicFunctions>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>precomp.hxx</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -170,6 +170,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>precomp.hxx</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -208,6 +209,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>precomp.hxx</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -239,6 +241,12 @@
<ClCompile Include="Src\dllmain.cpp" />
<ClCompile Include="Src\filewatcher.cxx" />
<ClCompile Include="src\globalmodule.cpp" />
<ClCompile Include="src\precomp.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Src\proxymodule.cxx" />
</ItemGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
#pragma once
#include "precomp.hxx"
#include <httpserv.h>
#include "hostfxroptions.h"
#include "appoffline.h"
@ -13,6 +13,7 @@
#include "aspnetcore_shim_config.h"
#include "iapplication.h"
#include "SRWSharedLock.h"
#include "ntassert.h"
#define API_BUFFER_TOO_SMALL 0x80008098

View File

@ -3,8 +3,6 @@
#pragma once
#include "precomp.hxx"
#include "applicationinfo.h"
#include "multisz.h"
#include "filewatcher.h"

View File

@ -3,7 +3,8 @@
#pragma once
#include "precomp.hxx"
#include "stringa.h"
#include "stringu.h"
class APP_OFFLINE_HTM
{

View File

@ -3,8 +3,10 @@
#pragma once
#include "precomp.hxx"
#include <map>
#include <windows.h>
#include <httpserv.h>
#include "stringu.h"
#define CS_ASPNETCORE_SECTION L"system.webServer/aspNetCore"
#define CS_ASPNETCORE_PROCESS_EXE_PATH L"processPath"

View File

@ -3,20 +3,12 @@
#pragma once
#include "precomp.hxx"
#include <windows.h>
#include "stringu.h"
#define FILE_WATCHER_SHUTDOWN_KEY (ULONG_PTR)(-1)
#define FILE_WATCHER_ENTRY_BUFFER_SIZE 4096
#ifndef CONTAINING_RECORD
//
// Calculate the address of the base of the structure given its type, and an
// address of a field within the structure.
//
#define CONTAINING_RECORD(address, type, field) \
((type *)((PCHAR)(address)-(ULONG_PTR)(&((type *)0)->field)))
#endif // !CONTAINING_RECORD
#define FILE_NOTIFY_VALID_MASK 0x00000fff
#define FILE_WATCHER_ENTRY_SIGNATURE ((DWORD) 'FWES')
#define FILE_WATCHER_ENTRY_SIGNATURE_FREE ((DWORD) 'sewf')

View File

@ -3,8 +3,6 @@
#pragma once
#include "precomp.hxx"
#include "applicationmanager.h"
class ASPNET_CORE_GLOBAL_MODULE : public CGlobalModule

View File

@ -16,40 +16,8 @@
#include <Windows.h>
#include <atlbase.h>
#include <httpserv.h>
#include "stringu.h"
#include "stringa.h"
#include "ntassert.h"
#include "dbgutil.h"
#include "aspnetcore_msg.h"
#include "resources.h"
#include <memory>
FORCEINLINE
DWORD
WIN32_FROM_HRESULT(
HRESULT hr
)
{
if ((FAILED(hr)) &&
(HRESULT_FACILITY(hr) == FACILITY_WIN32))
{
return HRESULT_CODE(hr);
}
return hr;
}
FORCEINLINE
HRESULT
HRESULT_FROM_GETLASTERROR()
{
return ( GetLastError() != NO_ERROR )
? HRESULT_FROM_WIN32( GetLastError() )
: E_FAIL;
}
#include "stringu.h"
extern PVOID g_pModuleId;
extern BOOL g_fAspnetcoreRHAssemblyLoaded;

View File

@ -3,8 +3,6 @@
#pragma once
#include "precomp.hxx"
#include "applicationinfo.h"
#include "irequesthandler.h"

View File

@ -7,6 +7,9 @@
#include "hostfxr_utility.h"
#include "utility.h"
#include "debugutil.h"
#include "resources.h"
#include "SRWExclusiveLock.h"
#include "GlobalVersionUtility.h"
const PCWSTR APPLICATION_INFO::s_pwzAspnetcoreInProcessRequestHandlerName = L"aspnetcorev2_inprocess.dll";
const PCWSTR APPLICATION_INFO::s_pwzAspnetcoreOutOfProcessRequestHandlerName = L"aspnetcorev2_outofprocess.dll";

View File

@ -1,10 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include <memory>
#include "applicationmanager.h"
#include "proxymodule.h"
#include "utility.h"
#include "resources.h"
#include "SRWExclusiveLock.h"
// The application manager is a singleton across ANCM.
APPLICATION_MANAGER* APPLICATION_MANAGER::sm_pApplicationManager = NULL;

View File

@ -5,7 +5,6 @@
#include "config_utility.h"
#include "hostfxr_utility.h"
#include "debugutil.h"
#include "ahutil.h"
ASPNETCORE_SHIM_CONFIG::~ASPNETCORE_SHIM_CONFIG()

View File

@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "precomp.hxx"
#include "applicationinfo.h"
#include "applicationmanager.h"
#include "proxymodule.h"
@ -10,6 +8,8 @@
#include "acache.h"
#include "utility.h"
#include "debugutil.h"
#include "resources.h"
#include "exceptions.h"
DECLARE_DEBUG_PRINT_OBJECT("aspnetcore.dll");

View File

@ -0,0 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Do not remove this file. It is used for precompiled header generation

View File

@ -7,7 +7,6 @@
#include "applicationinfo.h"
#include "acache.h"
#include "exceptions.h"
__override
HRESULT
ASPNET_CORE_PROXY_MODULE_FACTORY::GetHttpModule(

View File

@ -85,7 +85,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<Optimization>Disabled</Optimization>
@ -100,6 +100,7 @@
<AdditionalIncludeDirectories>..\iislib;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -108,7 +109,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<Optimization>Disabled</Optimization>
@ -124,6 +125,7 @@
<AdditionalIncludeDirectories>..\iislib;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -132,7 +134,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<Optimization>MaxSpeed</Optimization>
@ -148,6 +150,7 @@
<AdditionalIncludeDirectories>..\iislib;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -158,7 +161,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<Optimization>MaxSpeed</Optimization>
@ -176,6 +179,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
<LanguageStandard>stdcpp17</LanguageStandard>
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -215,6 +219,12 @@
<ClCompile Include="hostfxroptions.cpp" />
<ClCompile Include="SRWExclusiveLock.cpp" />
<ClCompile Include="SRWSharedLock.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="utility.cxx" />
</ItemGroup>
<ItemGroup>

View File

@ -3,4 +3,7 @@
#pragma once
#include "Utility.h"
#include "resources.h"
#define EVENTLOG(log, name, ...) UTILITY::LogEventF(log, ASPNETCORE_EVENT_ ## name ## _LEVEL, ASPNETCORE_EVENT_ ## name, ASPNETCORE_EVENT_ ## name ## _MSG, __VA_ARGS__)

View File

@ -1,7 +1,10 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "stdafx.h"
#include <Windows.h>
#include <experimental/filesystem>
#include "GlobalVersionUtility.h"
namespace fs = std::experimental::filesystem;

View File

@ -2,7 +2,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include <experimental/filesystem>
#include "fx_ver.h"
class GlobalVersionUtility
{

View File

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "stdafx.h"
#include "SRWExclusiveLock.h"
SRWExclusiveLock:: SRWExclusiveLock(const SRWLOCK& lock)

View File

@ -3,6 +3,8 @@
#pragma once
#include <synchapi.h>
class SRWExclusiveLock
{
public:

View File

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "stdafx.h"
#include "SRWSharedLock.h"
SRWSharedLock:: SRWSharedLock(const SRWLOCK& lock)

View File

@ -3,6 +3,8 @@
#pragma once
#include <synchapi.h>
class SRWSharedLock
{
public:

View File

@ -3,7 +3,8 @@
#pragma once
#include "stdafx.h"
#include "iapplication.h"
#include "ntassert.h"
class APPLICATION : public IAPPLICATION
{

View File

@ -3,7 +3,9 @@
#pragma once
#include "stdafx.h"
#include <httpserv.h>
#include "ahutil.h"
#include "stringu.h"
class ConfigUtility
{

View File

@ -1,10 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "stdafx.h"
#include "debugutil.h"
#include <string>
#include "dbgutil.h"
#include "stringu.h"
#include "stringa.h"
inline HANDLE g_hStandardOutput;

View File

@ -4,6 +4,7 @@
#pragma once
#include <Windows.h>
#include "dbgutil.h"
#define ASPNETCORE_DEBUG_FLAG_INFO DEBUG_FLAG_INFO
#define ASPNETCORE_DEBUG_FLAG_WARNING DEBUG_FLAG_WARN

View File

@ -1,7 +1,11 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "stdafx.h"
#include "fx_ver.h"
#include <Windows.h>
#include <sstream>
#include <cassert>
fx_ver_t::fx_ver_t(int major, int minor, int patch, const std::wstring& pre, const std::wstring& build)
: m_major(major)
@ -189,4 +193,4 @@ bool fx_ver_t::parse(const std::wstring& ver, fx_ver_t* fx_ver, bool parse_only_
bool valid = parse_internal(ver, fx_ver, parse_only_production);
assert(!valid || fx_ver->as_str() == ver);
return valid;
}
}

View File

@ -3,6 +3,8 @@
#pragma once
#include <string>
// Note: This is not SemVer (esp., in comparing pre-release part, fx_ver_t does not
// compare multiple dot separated identifiers individually.) ex: 1.0.0-beta.2 vs. 1.0.0-beta.11
struct fx_ver_t
@ -22,8 +24,6 @@ struct fx_ver_t
bool is_prerelease() const { return !m_pre.empty(); }
std::wstring as_str() const;
std::wstring prerelease_glob() const;
std::wstring patch_glob() const;
bool operator ==(const fx_ver_t& b) const;
bool operator !=(const fx_ver_t& b) const;

View File

@ -1,8 +1,12 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "stdafx.h"
#include "hostfxr_utility.h"
#include <string>
#include "EventLog.h"
#include "ntassert.h"
#include "fx_ver.h"
namespace fs = std::experimental::filesystem;

View File

@ -3,11 +3,11 @@
#pragma once
#include "precomp.h"
#include <Windows.h>
#include <vector>
#include <experimental/filesystem>
#include <optional>
#include "stringu.h"
typedef INT(*hostfxr_get_native_search_directories_fn) (CONST INT argc, CONST PCWSTR* argv, PWSTR buffer, DWORD buffer_size, DWORD* required_buffer_size);
typedef INT(*hostfxr_main_fn) (CONST DWORD argc, CONST PCWSTR argv[]);

View File

@ -1,7 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "stdafx.h"
#include "hostfxroptions.h"
#include "hostfxr_utility.h"
HRESULT HOSTFXR_OPTIONS::Create(
_In_ PCWSTR pcwzExeLocation,

View File

@ -3,8 +3,11 @@
#pragma once
#include <Windows.h>
#include <memory>
#include "stringu.h"
class HOSTFXR_OPTIONS
{
public:

View File

@ -3,7 +3,7 @@
#pragma once
class IREQUEST_HANDLER;
#include "irequesthandler.h"
enum APPLICATION_STATUS
{

View File

@ -3,6 +3,8 @@
#pragma once
#include <httpserv.h>
//
// Pure abstract class
//

View File

@ -3,7 +3,8 @@
#pragma once
#include "stdafx.h"
#include "irequesthandler.h"
#include "ntassert.h"
//
// Pure abstract class

View File

@ -3,6 +3,8 @@
#pragma once
#include "aspnetcore_msg.h"
#define IDS_INVALID_PROPERTY 1000
#define IDS_SERVER_ERROR 1001

View File

@ -0,0 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Do not remove this file. It is used for precompiled header generation

View File

@ -9,35 +9,9 @@
#include <Windows.h>
#include <httpserv.h>
#include <wchar.h>
#include <cwchar>
#include <vector>
#include <shellapi.h>
#include <sstream>
#include <memory>
#include <experimental/filesystem>
#include "Shlwapi.h"
#include <io.h>
#include "hashtable.h"
#include "stringu.h"
#include "stringa.h"
#include "multisz.h"
#include "dbgutil.h"
#include "ahutil.h"
#include "hashfn.h"
#include "sttimer.h"
#include "irequesthandler.h"
#include "sttimer.h"
#include "requesthandler.h"
#include "iapplication.h"
#include "application.h"
#include "SRWExclusiveLock.h"
#include "fx_ver.h"
#include "utility.h"
#include "GlobalVersionUtility.h"
#include "resources.h"
#include "aspnetcore_msg.h"
#include "hostfxr_utility.h"
#include "EventLog.h"
#include "hostfxroptions.h"
#include "exceptions.h"

View File

@ -3,7 +3,6 @@
#pragma once
#include "stdafx.h"
#ifndef _STTIMER_H
#define _STTIMER_H

View File

@ -1,7 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
#include "stdafx.h"
#include "utility.h"
#include <Shlwapi.h>
#include "debugutil.h"
// static

View File

@ -5,6 +5,10 @@
#include "stdafx.h"
#include <httpserv.h>
#include "stringa.h"
#include "stringu.h"
class UTILITY
{
public:

View File

@ -255,4 +255,4 @@ FindNextLocationElement(
HRESULT GetSharedConfigEnabled(
BOOL * pfIsSharedConfig
);
);

View File

@ -8,9 +8,9 @@
#include <VersionHelpers.h>
#include "inprocessapplication.h"
#include "inprocesshandler.h"
#include "requesthandler_config.h"
#include "debugutil.h"
#include "resources.h"
DECLARE_DEBUG_PRINT_OBJECT("aspnetcorev2_inprocess.dll");

View File

@ -7,6 +7,9 @@
#include "requesthandler_config.h"
#include "environmentvariablehelpers.h"
#include "aspnetcore_event.h"
#include "utility.h"
#include "EventLog.h"
#include "SRWExclusiveLock.h"
IN_PROCESS_APPLICATION* IN_PROCESS_APPLICATION::s_Application = NULL;
hostfxr_main_fn IN_PROCESS_APPLICATION::s_fMainCallback = NULL;

View File

@ -4,6 +4,7 @@
#pragma once
#include "precomp.hxx"
#include "application.h"
#include "inprocesshandler.h"
#include "requesthandler_config.h"

View File

@ -3,6 +3,7 @@
#include "stdafx.h"
#include "sttimer.h"
#include "utility.h"
FileOutputManager::FileOutputManager()
{
@ -160,8 +161,8 @@ FileOutputManager::Start()
// There are a few options for redirecting stdout/stderr,
// but there are issues with most of them.
// AllocConsole()
// *stdout = *m_pStdFile;
// AllocConsole()
// *stdout = *m_pStdFile;
// *stderr = *m_pStdFile;
// Calling _dup2 on stderr fails on IIS. IIS sets stderr to -2
// _dup2(_fileno(m_pStdFile), _fileno(stdout));