HRESULT CDebugLogElement::Create(DWORD dwDetailLvl, LPCWSTR pwzMsg, BOOL bEscapeEntities, CDebugLogElement **ppLogElem) { HRESULT hr = S_OK; CDebugLogElement *pLogElem = NULL; MEMORY_REPORT_CONTEXT_SCOPE("FusionLog"); if (!ppLogElem || !pwzMsg) { hr = E_INVALIDARG; goto Exit; } *ppLogElem = NULL; pLogElem = NEW(CDebugLogElement(dwDetailLvl)); if (!pLogElem) { hr = E_OUTOFMEMORY; goto Exit; } hr = pLogElem->Init(pwzMsg, bEscapeEntities); if (FAILED(hr)) { SAFEDELETE(pLogElem); goto Exit; } *ppLogElem = pLogElem; Exit: return hr; }
HRESULT CDebugLogElement::Create(DWORD dwDetailLvl, LPCWSTR pwzMsg, CDebugLogElement **ppLogElem) { HRESULT hr = S_OK; CDebugLogElement *pLogElem = NULL; if (!ppLogElem || !pwzMsg) { hr = E_INVALIDARG; goto Exit; } *ppLogElem = NULL; pLogElem = FUSION_NEW_SINGLETON(CDebugLogElement(dwDetailLvl)); if (!pLogElem) { hr = E_OUTOFMEMORY; goto Exit; } hr = pLogElem->Init(pwzMsg); if (FAILED(hr)) { SAFEDELETE(pLogElem); goto Exit; } *ppLogElem = pLogElem; Exit: return hr; }