Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 6 additions & 93 deletions src/Servers/IIS/AspNetCoreModuleV2/IISLib/IISLib.vcxproj
Original file line number Diff line number Diff line change
@@ -1,123 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Any CPU">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Any CPU">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<Import Project="..\..\build\Build.Lib.Settings" />
<PropertyGroup Label="Globals">
<ProjectGuid>{09D9D1D6-2951-4E14-BC35-76A23CF9391A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>IISLib</RootNamespace>
<ProjectName>IISLib</ProjectName>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion>14.29.30133</VCToolsVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64' OR '$(Configuration)|$(Platform)'=='Debug|ARM64' OR '$(Configuration)|$(Platform)'=='Debug|Any CPU'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64' OR '$(Configuration)|$(Platform)'=='Release|ARM64' OR '$(Configuration)|$(Platform)'=='Release|Any CPU'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(PlatformToolsetVersion)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32' OR'$(Configuration)|$(Platform)'=='Debug|x64' OR '$(Configuration)|$(Platform)'=='Debug|ARM64' OR '$(Configuration)|$(Platform)'=='Debug|Any CPU'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
<TreatWarningAsError>true</TreatWarningAsError>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32' OR '$(Configuration)|$(Platform)'=='Release|x64' OR '$(Configuration)|$(Platform)'=='Release|ARM64' OR '$(Configuration)|$(Platform)'=='Release|Any CPU'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
<TreatWarningAsError>true</TreatWarningAsError>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalOptions>/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib %(AdditionalOptions)</AdditionalOptions>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
19 changes: 12 additions & 7 deletions src/Servers/IIS/AspNetCoreModuleV2/IISLib/acache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ HANDLE ALLOC_CACHE_HANDLER::sm_hHeap;
// memory block to a FREE_LIST_HEADER*. The signature is used to guard against
// double deletion. We also fill memory with a pattern.
//
// Disabling C4324 here; alignment comes from SLIST_ENTRY definition.
#pragma warning(push)
#pragma warning(disable:4324)
class FREE_LIST_HEADER
{
public:
Expand All @@ -25,6 +28,7 @@ class FREE_LIST_HEADER
FREE_SIGNATURE = (('A') | ('C' << 8) | ('a' << 16) | (('$' << 24) | 0x80)),
};
};
#pragma warning(pop)

ALLOC_CACHE_HANDLER::ALLOC_CACHE_HANDLER(
) : m_nThreshold(0),
Expand Down Expand Up @@ -75,7 +79,7 @@ ALLOC_CACHE_HANDLER::Initialize(
//
m_cbSize = cbSize;
m_cbSize = max(m_cbSize, sizeof(FREE_LIST_HEADER));

//
// Round up the block size to a multiple of the size of a LONG (for
// the fill pattern in Free()).
Expand All @@ -97,7 +101,7 @@ ALLOC_CACHE_HANDLER::Initialize(
}
} Init;
#endif

hr = PER_CPU<SLIST_HEADER>::Create(Init,
&m_pFreeLists );
if (FAILED(hr))
Expand Down Expand Up @@ -223,6 +227,7 @@ ALLOC_CACHE_HANDLER::Alloc(
// on memory that they've freed.
//
DBG_ASSERT(pfl->dwSignature == FREE_LIST_HEADER::FREE_SIGNATURE);
(void)pfl;
}
}

Expand Down Expand Up @@ -319,11 +324,11 @@ ALLOC_CACHE_HANDLER::QueryDepthForAllSLists(
/*++

Description:

Aggregates the total count of elements in all lists.

Arguments:

None.

Return Value:
Expand Down Expand Up @@ -388,7 +393,7 @@ ALLOC_CACHE_HANDLER::IsPageheapEnabled(
}

//
// Create a heap for calling heapwalk
// Create a heap for calling heapwalk
// otherwise HeapWalk turns off lookasides for a useful heap
//
hHeap = ::HeapCreate( 0, 0, 0 );
Expand All @@ -397,7 +402,7 @@ ALLOC_CACHE_HANDLER::IsPageheapEnabled(
fRet = FALSE;
goto Finished;
}

fRet = ::HeapLock( hHeap );
if ( !fRet )
{
Expand Down
14 changes: 7 additions & 7 deletions src/Servers/IIS/AspNetCoreModuleV2/IISLib/multisz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ BOOL MULTISZ::AuxAppend( const WCHAR * pStr, UINT cbStr, BOOL fAddSlop )
//

//AcIncrement( CacMultiszAppend);
//

//
// Check for the arithmetic overflow
//
// ( 2 * sizeof( WCHAR ) ) is for the double terminator
Expand All @@ -197,7 +197,7 @@ BOOL MULTISZ::AuxAppend( const WCHAR * pStr, UINT cbStr, BOOL fAddSlop )
if ( QuerySize() < (DWORD) cb64Required )
{
ULONGLONG cb64AllocSize = cb64Required + (fAddSlop ? STR_SLOP : 0 );
//
//
// Check for the arithmetic overflow
//
if ( cb64AllocSize > MAXULONG )
Expand Down Expand Up @@ -310,7 +310,7 @@ MULTISZ::CopyToBuffer( __out_ecount_opt(*lpcch) WCHAR * lpszBuffer, LPDWORD lpcc
return ( FALSE);
}

register DWORD cch = QueryCCH();
DWORD cch = QueryCCH();

if ( *lpcch >= cch) {

Expand Down Expand Up @@ -397,7 +397,7 @@ Return Value:
hr = HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER );
goto Finished;
}

pmszList->Reset();

/*
Expand All @@ -409,7 +409,7 @@ Return Value:

pszEnd: just past the end of the current entry
*/

for ( PCWSTR pszCurrent = pszList,
pszNext = wcschr( pszCurrent, L',' )
;
Expand Down Expand Up @@ -449,7 +449,7 @@ Return Value:
goto Finished;
}
}

if ( pszNext == NULL )
{
break;
Expand Down
27 changes: 15 additions & 12 deletions src/Servers/IIS/AspNetCoreModuleV2/IISLib/percpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,23 @@ PER_CPU<T>::Create(
ObjectCacheLineSize = CacheLineSize;
}

//
// Calculate the size of the PER_CPU<T> object, including the array.
// The first cache line is for the member variables and the array
// starts in the next cache line.
//
SIZE_T Size = CacheLineSize + NumberOfProcessors * ObjectCacheLineSize;

pInstance = (PER_CPU<T>*) _aligned_malloc(Size, CacheLineSize);
if (pInstance == NULL)
{
hr = E_OUTOFMEMORY;
goto Finished;
//
// Calculate the size of the PER_CPU<T> object, including the array.
// The first cache line is for the member variables and the array
// starts in the next cache line.
//
SIZE_T Size = CacheLineSize + NumberOfProcessors * ObjectCacheLineSize;

pInstance = (PER_CPU<T>*) _aligned_malloc(Size, CacheLineSize);
if (pInstance == NULL)
{
hr = E_OUTOFMEMORY;
goto Finished;
}

ZeroMemory(pInstance, Size);
}
ZeroMemory(pInstance, Size);

//
// The array start in the 2nd cache line.
Expand Down
2 changes: 2 additions & 0 deletions src/Servers/IIS/AspNetCoreModuleV2/IISLib/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Loading