diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/IISLib.vcxproj b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/IISLib.vcxproj index c98cef56331b..859e35792836 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/IISLib.vcxproj +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/IISLib.vcxproj @@ -1,123 +1,36 @@  - - - Debug - Win32 - - - Debug - x64 - - - Debug - ARM64 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - Release - ARM64 - - - Release - x64 - - + {09D9D1D6-2951-4E14-BC35-76A23CF9391A} - Win32Proj IISLib IISLib - 10.0.18362.0 - - - - 14.29.30133 - - - StaticLibrary - false - $(PlatformToolsetVersion) - Unicode - - - StaticLibrary - false - $(PlatformToolsetVersion) - Unicode - - StaticLibrary - false - $(PlatformToolsetVersion) + true - Unicode - - StaticLibrary - false - $(PlatformToolsetVersion) - true - Unicode - - - - - - - - - + - Level3 - Disabled - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + WIN32;%(PreprocessorDefinitions) true ProgramDatabase - MultiThreaded - false - true - true - Windows true - + - Level3 - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;%(PreprocessorDefinitions) true - MultiThreaded - false - true - true - Windows true - true /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib %(AdditionalOptions) - true diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/acache.cpp b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/acache.cpp index 0a7d9488d93c..d2de16a7ae31 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/acache.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/acache.cpp @@ -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: @@ -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), @@ -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()). @@ -97,7 +101,7 @@ ALLOC_CACHE_HANDLER::Initialize( } } Init; #endif - + hr = PER_CPU::Create(Init, &m_pFreeLists ); if (FAILED(hr)) @@ -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; } } @@ -319,11 +324,11 @@ ALLOC_CACHE_HANDLER::QueryDepthForAllSLists( /*++ Description: - + Aggregates the total count of elements in all lists. - + Arguments: - + None. Return Value: @@ -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 ); @@ -397,7 +402,7 @@ ALLOC_CACHE_HANDLER::IsPageheapEnabled( fRet = FALSE; goto Finished; } - + fRet = ::HeapLock( hHeap ); if ( !fRet ) { diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/multisz.cpp b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/multisz.cpp index b50a4839837e..1342e2ffd28e 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/multisz.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/multisz.cpp @@ -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 @@ -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 ) @@ -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) { @@ -397,7 +397,7 @@ Return Value: hr = HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER ); goto Finished; } - + pmszList->Reset(); /* @@ -409,7 +409,7 @@ Return Value: pszEnd: just past the end of the current entry */ - + for ( PCWSTR pszCurrent = pszList, pszNext = wcschr( pszCurrent, L',' ) ; @@ -449,7 +449,7 @@ Return Value: goto Finished; } } - + if ( pszNext == NULL ) { break; diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/percpu.h b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/percpu.h index da417b334039..46d7b7e5e7fd 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/percpu.h +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/percpu.h @@ -115,20 +115,23 @@ PER_CPU::Create( ObjectCacheLineSize = CacheLineSize; } - // - // Calculate the size of the PER_CPU 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*) _aligned_malloc(Size, CacheLineSize); - if (pInstance == NULL) { - hr = E_OUTOFMEMORY; - goto Finished; + // + // Calculate the size of the PER_CPU 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*) _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. diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stdafx.h b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stdafx.h new file mode 100644 index 000000000000..48c91eb325ef --- /dev/null +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stdafx.h @@ -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. diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringa.cpp b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringa.cpp index 4f757df05742..8e2cbfe9caf0 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringa.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringa.cpp @@ -679,7 +679,7 @@ Return Value: int i = 0; BYTE ch; HRESULT hr = S_OK; - SIZE_T NewSize = 0; + ULONG64 NewSize = 0; // Set to true if any % escaping occurs BOOL fEscapingDone = FALSE; @@ -695,13 +695,14 @@ Return Value: _ASSERTE( pch ); - while (ch = pch[i]) + while (pch[i] != NULL) { // // Escape characters that are in the non-printable range // but ignore CR and LF // + ch = pch[i]; if ( pfnFShouldEscape( ch ) ) { if (FALSE == fEscapingDone) @@ -711,7 +712,7 @@ Return Value: // guess that the size needs to be larger than // what we used to have times two - NewSize = QueryCCH() * 2; + NewSize = static_cast(QueryCCH()) * 2; if ( NewSize > MAXDWORD ) { hr = HRESULT_FROM_WIN32( ERROR_ARITHMETIC_OVERFLOW ); @@ -740,14 +741,14 @@ Return Value: // resize the temporary (if needed) with the slop of the entire buffer length // this fixes constant reallocation if the entire string needs to be escaped - NewSize = QueryCCH() + 2 * sizeof(CHAR) + 1 * sizeof(CHAR); + NewSize = static_cast(QueryCCH()) + 2 * sizeof(CHAR) + 1 * sizeof(CHAR); if ( NewSize > MAXDWORD ) { hr = HRESULT_FROM_WIN32( ERROR_ARITHMETIC_OVERFLOW ); return hr; } - BOOL fRet = straTemp.m_Buff.Resize(NewSize); + BOOL fRet = straTemp.m_Buff.Resize(static_cast(NewSize)); if ( !fRet ) { hr = HRESULT_FROM_WIN32(GetLastError()); @@ -1038,6 +1039,8 @@ STRA::AuxAppendW( { HRESULT hr = S_OK; DWORD cbRet = 0; + DWORD cbAvailable = 0; + UNREFERENCED_PARAMETER(fFailIfNoTranslation); // // There are only two expect places to append @@ -1058,7 +1061,7 @@ STRA::AuxAppendW( goto Finished; } - DWORD cbAvailable = m_Buff.QuerySize() - cbOffset; + cbAvailable = m_Buff.QuerySize() - cbOffset; cbRet = WideCharToMultiByte( CodePage, @@ -1166,28 +1169,23 @@ STRA::AuxAppendWTruncate( // Cheesey WCHAR --> CHAR conversion // { - HRESULT hr = S_OK; - _ASSERTE( NULL != pszAppendW ); _ASSERTE( 0 == cbOffset || cbOffset == QueryCB() ); if( !pszAppendW ) { - hr = HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER ); - goto Finished; + return HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER ); } ULONGLONG cbNeeded = static_cast(cbOffset) + cchAppendW + sizeof( CHAR ); if( cbNeeded > MAXDWORD ) { - hr = HRESULT_FROM_WIN32( ERROR_ARITHMETIC_OVERFLOW ); - goto Finished; + return HRESULT_FROM_WIN32( ERROR_ARITHMETIC_OVERFLOW ); } if( !m_Buff.Resize( static_cast(cbNeeded) ) ) { - hr = E_OUTOFMEMORY; - goto Finished; + return E_OUTOFMEMORY; } // @@ -1202,9 +1200,7 @@ STRA::AuxAppendWTruncate( m_cchLen = cchAppendW + cbOffset; *( QueryStr() + m_cchLen ) = '\0'; -Finished: - - return hr; + return S_OK; } // static @@ -1440,30 +1436,26 @@ STRA::StartsWith( __in PCSTR pszPrefix, __in bool fIgnoreCase) const { - BOOL fMatch = FALSE; - size_t cchPrefix = 0; - if (pszPrefix == NULL) { - goto Finished; + return FALSE; } - HRESULT hr = StringCchLengthA(pszPrefix, - STRSAFE_MAX_CCH, - &cchPrefix); + size_t cchPrefix = 0; + HRESULT hr = StringCchLengthA(pszPrefix, STRSAFE_MAX_CCH, &cchPrefix); if (FAILED(hr)) { - goto Finished; + return FALSE; } _ASSERTE( cchPrefix <= MAXDWORD ); - if (cchPrefix > m_cchLen) { - goto Finished; + return FALSE; } - if( fIgnoreCase ) + BOOL fMatch = FALSE; + if ( fIgnoreCase ) { fMatch = ( 0 == _strnicmp( QueryStr(), pszPrefix, cchPrefix ) ); } @@ -1472,9 +1464,6 @@ STRA::StartsWith( fMatch = ( 0 == strncmp( QueryStr(), pszPrefix, cchPrefix ) ); } - -Finished: - return fMatch; } @@ -1551,33 +1540,30 @@ STRA::EndsWith( __in bool fIgnoreCase) const { PSTR pszString = QueryStr(); - BOOL fMatch = FALSE; - size_t cchSuffix = 0; if (pszSuffix == NULL) { - goto Finished; + return FALSE; } - HRESULT hr = StringCchLengthA(pszSuffix, - STRSAFE_MAX_CCH, - &cchSuffix); + size_t cchSuffix = 0; + HRESULT hr = StringCchLengthA(pszSuffix, STRSAFE_MAX_CCH, &cchSuffix); if (FAILED(hr)) { - goto Finished; + return FALSE; } _ASSERTE( cchSuffix <= MAXDWORD ); - if (cchSuffix > m_cchLen) { - goto Finished; + return FALSE; } ptrdiff_t ixOffset = m_cchLen - cchSuffix; _ASSERTE(ixOffset >= 0 && ixOffset <= MAXDWORD); - if( fIgnoreCase ) + BOOL fMatch = FALSE; + if ( fIgnoreCase ) { fMatch = ( 0 == _strnicmp( pszString + ixOffset, pszSuffix, cchSuffix ) ); } @@ -1586,8 +1572,6 @@ STRA::EndsWith( fMatch = ( 0 == strncmp( pszString + ixOffset, pszSuffix, cchSuffix ) ); } -Finished: - return fMatch; } @@ -1619,22 +1603,20 @@ STRA::IndexOf( INT nIndex = -1; // Make sure that there are no buffer overruns. - if( dwStartIndex >= QueryCCH() ) + if ( dwStartIndex >= QueryCCH() ) { - goto Finished; + return nIndex; } const CHAR* pChar = strchr( QueryStr() + dwStartIndex, charValue ); // Determine the index if found - if( pChar ) + if ( pChar ) { // nIndex will be set to -1 on failure. (VOID)SizeTToInt( pChar - QueryStr(), &nIndex ); } -Finished: - return nIndex; } @@ -1663,14 +1645,12 @@ STRA::IndexOf( __in DWORD dwStartIndex ) const { - HRESULT hr = S_OK; INT nIndex = -1; - SIZE_T cchValue = 0; // Validate input parameters if( dwStartIndex >= QueryCCH() || !pszValue ) { - goto Finished; + return nIndex; } const CHAR* pChar = strstr( QueryStr() + dwStartIndex, pszValue ); @@ -1682,8 +1662,6 @@ STRA::IndexOf( (VOID)SizeTToInt( pChar - QueryStr(), &nIndex ); } -Finished: - return nIndex; } @@ -1717,7 +1695,7 @@ STRA::LastIndexOf( // Make sure that there are no buffer overruns. if( dwStartIndex >= QueryCCH() ) { - goto Finished; + return nIndex; } const CHAR* pChar = strrchr( QueryStr() + dwStartIndex, charValue ); @@ -1729,7 +1707,5 @@ STRA::LastIndexOf( (VOID)SizeTToInt( pChar - QueryStr(), &nIndex ); } -Finished: - return nIndex; } diff --git a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringu.cpp b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringu.cpp index f55f4982394c..e76087708297 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringu.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/IISLib/stringu.cpp @@ -774,9 +774,9 @@ Return Value: // Only resize when we have to. When we do resize, we tack on // some extra space to avoid extra reallocations. // - if( m_Buff.QuerySize() < (ULONGLONG)cbOffset + (cbStr * sizeof( WCHAR )) + sizeof(WCHAR) ) + if (m_Buff.QuerySize() < (ULONGLONG)cbOffset + (cbStr * sizeof(WCHAR)) + sizeof(WCHAR)) { - ULONGLONG cb64NewSize = (ULONGLONG)( cbOffset + cbStr * sizeof(WCHAR) + sizeof( WCHAR ) ); + ULONGLONG cb64NewSize = (ULONGLONG)cbOffset + (ULONGLONG)cbStr * sizeof(WCHAR) + sizeof(WCHAR); // // Check for the arithmetic overflow @@ -905,50 +905,41 @@ STRU::StartsWith( __in PCWSTR pwszPrefix, __in bool fIgnoreCase) const { - BOOL fMatch = FALSE; - size_t cchPrefix = 0; - if (pwszPrefix == NULL) { - goto Finished; + return FALSE; } - HRESULT hr = StringCchLengthW(pwszPrefix, - STRSAFE_MAX_CCH, - &cchPrefix); + size_t cchPrefix = 0; + HRESULT hr = StringCchLengthW(pwszPrefix, STRSAFE_MAX_CCH, &cchPrefix); if (FAILED(hr)) { - goto Finished; + return FALSE; } - _ASSERTE( cchPrefix <= MAXDWORD ); - + _ASSERTE(cchPrefix <= MAXDWORD); if (cchPrefix > m_cchLen) { - goto Finished; + return FALSE; } - #if defined( NTDDI_VERSION ) && NTDDI_VERSION >= NTDDI_LONGHORN - - fMatch = ( CSTR_EQUAL == CompareStringOrdinal( QueryStr(), - cchPrefix, - pwszPrefix, - cchPrefix, - fIgnoreCase ) ); - #else - - if( fIgnoreCase ) - { - fMatch = ( 0 == _wcsnicmp( QueryStr(), pwszPrefix, cchPrefix ) ); - } - else - { - fMatch = ( 0 == wcsncmp( QueryStr(), pwszPrefix, cchPrefix ) ); - } - - #endif - -Finished: + BOOL fMatch = FALSE; +#if defined( NTDDI_VERSION ) && NTDDI_VERSION >= NTDDI_LONGHORN + fMatch = ( CSTR_EQUAL == CompareStringOrdinal( QueryStr(), + cchPrefix, + pwszPrefix, + cchPrefix, + fIgnoreCase ) ); +#else + if( fIgnoreCase ) + { + fMatch = ( 0 == _wcsnicmp( QueryStr(), pwszPrefix, cchPrefix ) ); + } + else + { + fMatch = ( 0 == wcsncmp( QueryStr(), pwszPrefix, cchPrefix ) ); + } +#endif return fMatch; } @@ -977,53 +968,45 @@ STRU::EndsWith( __in bool fIgnoreCase) const { PWSTR pwszString = QueryStr(); - BOOL fMatch = FALSE; size_t cchSuffix = 0; if (pwszSuffix == NULL) { - goto Finished; + return FALSE; } - HRESULT hr = StringCchLengthW(pwszSuffix, - STRSAFE_MAX_CCH, - &cchSuffix); + HRESULT hr = StringCchLengthW(pwszSuffix, STRSAFE_MAX_CCH, &cchSuffix); if (FAILED(hr)) { - goto Finished; + return FALSE; } - _ASSERTE( cchSuffix <= MAXDWORD ); - + _ASSERTE(cchSuffix <= MAXDWORD); if (cchSuffix > m_cchLen) { - goto Finished; + return FALSE; } ptrdiff_t ixOffset = m_cchLen - cchSuffix; _ASSERTE(ixOffset >= 0 && ixOffset <= MAXDWORD); - #if defined( NTDDI_VERSION ) && NTDDI_VERSION >= NTDDI_LONGHORN - - fMatch = ( CSTR_EQUAL == CompareStringOrdinal( pwszString + ixOffset, - cchSuffix, - pwszSuffix, - cchSuffix, - fIgnoreCase ) ); - #else - - if( fIgnoreCase ) - { - fMatch = ( 0 == _wcsnicmp( pwszString + ixOffset, pwszSuffix, cchSuffix ) ); - } - else - { - fMatch = ( 0 == wcsncmp( pwszString + ixOffset, pwszSuffix, cchSuffix ) ); - } - - #endif - -Finished: + BOOL fMatch = FALSE; +#if defined( NTDDI_VERSION ) && NTDDI_VERSION >= NTDDI_LONGHORN + fMatch = ( CSTR_EQUAL == CompareStringOrdinal( pwszString + ixOffset, + cchSuffix, + pwszSuffix, + cchSuffix, + fIgnoreCase ) ); +#else + if( fIgnoreCase ) + { + fMatch = ( 0 == _wcsnicmp( pwszString + ixOffset, pwszSuffix, cchSuffix ) ); + } + else + { + fMatch = ( 0 == wcsncmp( pwszString + ixOffset, pwszSuffix, cchSuffix ) ); + } +#endif return fMatch; } @@ -1057,7 +1040,7 @@ STRU::IndexOf( // Make sure that there are no buffer overruns. if( dwStartIndex >= QueryCCH() ) { - goto Finished; + return nIndex; } const WCHAR* pwChar = wcschr( QueryStr() + dwStartIndex, charValue ); @@ -1069,8 +1052,6 @@ STRU::IndexOf( (VOID)SizeTToInt( pwChar - QueryStr(), &nIndex ); } -Finished: - return nIndex; } @@ -1099,14 +1080,12 @@ STRU::IndexOf( __in DWORD dwStartIndex ) const { - HRESULT hr = S_OK; INT nIndex = -1; - SIZE_T cchValue = 0; // Validate input parameters if( dwStartIndex >= QueryCCH() || !pwszValue ) { - goto Finished; + return nIndex; } const WCHAR* pwChar = wcsstr( QueryStr() + dwStartIndex, pwszValue ); @@ -1118,8 +1097,6 @@ STRU::IndexOf( (VOID)SizeTToInt( pwChar - QueryStr(), &nIndex ); } -Finished: - return nIndex; } @@ -1153,7 +1130,7 @@ STRU::LastIndexOf( // Make sure that there are no buffer overruns. if( dwStartIndex >= QueryCCH() ) { - goto Finished; + return nIndex; } const WCHAR* pwChar = wcsrchr( QueryStr() + dwStartIndex, charValue ); @@ -1165,8 +1142,6 @@ STRU::LastIndexOf( (VOID)SizeTToInt( pwChar - QueryStr(), &nIndex ); } -Finished: - return nIndex; } @@ -1186,47 +1161,41 @@ Return Value: HRESULT --*/ { - HRESULT hr = S_OK; - if ( pszString == NULL || - pstrExpandedString == NULL ) + if (pszString == NULL || pstrExpandedString == NULL) { DBG_ASSERT( FALSE ); - hr = HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER ); - goto Exit; + return HRESULT_FROM_WIN32( ERROR_INVALID_PARAMETER ); } + DWORD cchNewSize = ExpandEnvironmentStrings(pszString, pstrExpandedString->QueryStr(), pstrExpandedString->QuerySizeCCH()); - if ( cchNewSize == 0 ) + if (cchNewSize == 0) { - hr = HRESULT_FROM_WIN32( GetLastError() ); - goto Exit; + return HRESULT_FROM_WIN32(GetLastError()); } - if ( cchNewSize > pstrExpandedString->QuerySizeCCH() ) + + if (cchNewSize > pstrExpandedString->QuerySizeCCH()) { - hr = pstrExpandedString->Resize( - ( cchNewSize + 1 ) * sizeof( WCHAR ) - ); - if ( FAILED( hr ) ) + HRESULT hr = pstrExpandedString->Resize(( cchNewSize + 1 ) * sizeof( WCHAR )); + if (FAILED(hr)) { - goto Exit; + return hr; } + cchNewSize = ExpandEnvironmentStrings( pszString, pstrExpandedString->QueryStr(), pstrExpandedString->QuerySizeCCH() ); - if ( cchNewSize == 0 || - cchNewSize > pstrExpandedString->QuerySizeCCH() ) + if (cchNewSize == 0 || cchNewSize > pstrExpandedString->QuerySizeCCH()) { - hr = HRESULT_FROM_WIN32( GetLastError() ); - goto Exit; + return HRESULT_FROM_WIN32( GetLastError() ); } } + pstrExpandedString->SyncWithBuffer(); - hr = S_OK; -Exit: - return hr; + return S_OK; } #pragma warning( pop ) diff --git a/src/Servers/IIS/build/Build.Common.Settings b/src/Servers/IIS/build/Build.Common.Settings index fd7a83ae5a7c..b013ae03055b 100644 --- a/src/Servers/IIS/build/Build.Common.Settings +++ b/src/Servers/IIS/build/Build.Common.Settings @@ -43,7 +43,9 @@ $(IntDir)$(TargetName).pch stdafx.h true + Level4 + 4018;4055;4146;4242;4244;4267;4302;4308;4509;4510;4532;4533;4610;4611;4700;4701;4703;4789;4995;4996 MultiThreaded false true