Index: reactos/dll/shellext/acppage/CLayerUIPropPage.cpp =================================================================== --- reactos/dll/shellext/acppage/CLayerUIPropPage.cpp (revision 75532) +++ reactos/dll/shellext/acppage/CLayerUIPropPage.cpp (working copy) @@ -158,6 +158,27 @@ } return InitFile(Buffer); } + + CString tmp; + if (tmp.GetEnvironmentVariable(L"SystemRoot")) + { + tmp += L"\\System32"; + if (ExpandedFilename.GetLength() >= tmp.GetLength() && + ExpandedFilename.Left(tmp.GetLength()).MakeLower() == tmp.MakeLower()) + { + ACDBG(L"Ignoring System32: %s\r\n", (PCWSTR)ExpandedFilename); + return E_FAIL; + } + tmp.GetEnvironmentVariable(L"SystemRoot"); + tmp += L"\\WinSxs"; + if (ExpandedFilename.GetLength() >= tmp.GetLength() && + ExpandedFilename.Left(tmp.GetLength()).MakeLower() == tmp.MakeLower()) + { + ACDBG(L"Ignoring WinSxs: %s\r\n", (PCWSTR)ExpandedFilename); + return E_FAIL; + } + } + for (size_t n = 0; g_AllowedExtensions[n]; ++n) { if (!wcsicmp(g_AllowedExtensions[n], pwszExt)) Index: reactos/sdk/lib/atl/atlsimpstr.h =================================================================== --- reactos/sdk/lib/atl/atlsimpstr.h (revision 75532) +++ reactos/sdk/lib/atl/atlsimpstr.h (working copy) @@ -162,9 +162,8 @@ int nLength = StringLength(pszSrc); CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR)); if (pData == NULL) - { - throw; // ThrowMemoryException(); - } + ThrowMemoryException(); + Attach(pData); SetLength(nLength); CopyChars(m_pszData, nLength, pszSrc, nLength); @@ -176,12 +175,12 @@ _Inout_ IAtlStringMgr* pStringMgr) { if (pchSrc == NULL && nLength != 0) - throw; + ThrowInvalidArgException(); CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR)); if (pData == NULL) { - throw; // ThrowMemoryException(); + ThrowMemoryException(); } Attach(pData); SetLength(nLength); @@ -615,6 +614,11 @@ AtlThrow(E_OUTOFMEMORY); } + static void ThrowInvalidArgException() + { + AtlThrow(E_INVALIDARG); + } + }; #ifdef UNICODE