From c06d8a94c9ce239f476f4043631778f58edd65b7 Mon Sep 17 00:00:00 2001 From: Mark Jansen Date: Tue, 15 Aug 2017 09:02:17 +0000 Subject: [PATCH] [ATL] Use the AtlThrow helper so we can disable exceptions by defining _ATL_NO_EXCEPTIONS svn path=/trunk/; revision=75549 --- reactos/sdk/lib/atl/atlsimpstr.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/reactos/sdk/lib/atl/atlsimpstr.h b/reactos/sdk/lib/atl/atlsimpstr.h index 64d3c7d7db4..05e582fc6f8 100644 --- a/reactos/sdk/lib/atl/atlsimpstr.h +++ b/reactos/sdk/lib/atl/atlsimpstr.h @@ -162,9 +162,8 @@ public: 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 @@ public: _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 @@ private: AtlThrow(E_OUTOFMEMORY); } + static void ThrowInvalidArgException() + { + AtlThrow(E_INVALIDARG); + } + }; #ifdef UNICODE -- 2.17.1