Author: mjansen
Date: Tue Aug 15 09:02:17 2017
New Revision: 75549
URL:
http://svn.reactos.org/svn/reactos?rev=75549&view=rev
Log:
[ATL] Use the AtlThrow helper so we can disable exceptions by defining _ATL_NO_EXCEPTIONS
Modified:
trunk/reactos/sdk/lib/atl/atlsimpstr.h
Modified: trunk/reactos/sdk/lib/atl/atlsimpstr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlsimpstr.h?r…
==============================================================================
--- trunk/reactos/sdk/lib/atl/atlsimpstr.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlsimpstr.h [iso-8859-1] Tue Aug 15 09:02:17 2017
@@ -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