mirror of
https://github.com/reactos/reactos.git
synced 2025-01-06 06:20:13 +00:00
[ATL] Use the AtlThrow helper so we can disable exceptions by defining _ATL_NO_EXCEPTIONS
svn path=/trunk/; revision=75549
This commit is contained in:
parent
4730de1195
commit
c06d8a94c9
1 changed files with 9 additions and 5 deletions
|
@ -162,9 +162,8 @@ public:
|
||||||
int nLength = StringLength(pszSrc);
|
int nLength = StringLength(pszSrc);
|
||||||
CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR));
|
CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR));
|
||||||
if (pData == NULL)
|
if (pData == NULL)
|
||||||
{
|
ThrowMemoryException();
|
||||||
throw; // ThrowMemoryException();
|
|
||||||
}
|
|
||||||
Attach(pData);
|
Attach(pData);
|
||||||
SetLength(nLength);
|
SetLength(nLength);
|
||||||
CopyChars(m_pszData, nLength, pszSrc, nLength);
|
CopyChars(m_pszData, nLength, pszSrc, nLength);
|
||||||
|
@ -176,12 +175,12 @@ public:
|
||||||
_Inout_ IAtlStringMgr* pStringMgr)
|
_Inout_ IAtlStringMgr* pStringMgr)
|
||||||
{
|
{
|
||||||
if (pchSrc == NULL && nLength != 0)
|
if (pchSrc == NULL && nLength != 0)
|
||||||
throw;
|
ThrowInvalidArgException();
|
||||||
|
|
||||||
CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR));
|
CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR));
|
||||||
if (pData == NULL)
|
if (pData == NULL)
|
||||||
{
|
{
|
||||||
throw; // ThrowMemoryException();
|
ThrowMemoryException();
|
||||||
}
|
}
|
||||||
Attach(pData);
|
Attach(pData);
|
||||||
SetLength(nLength);
|
SetLength(nLength);
|
||||||
|
@ -615,6 +614,11 @@ private:
|
||||||
AtlThrow(E_OUTOFMEMORY);
|
AtlThrow(E_OUTOFMEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ThrowInvalidArgException()
|
||||||
|
{
|
||||||
|
AtlThrow(E_INVALIDARG);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
|
|
Loading…
Reference in a new issue