crAddFile2W(PCWSTR pszFile, PCWSTR pszDestFile, PCWSTR pszDesc, DWORD dwFlags) { crSetErrorMsg(_T("Success.")); strconv_t strconv; CCrashHandler *pCrashHandler = CCrashHandler::GetCurrentProcessCrashHandler(); if(pCrashHandler==NULL) { crSetErrorMsg(_T("Crash handler wasn't previously installed for current process.")); return 1; // No handler installed for current process? } LPCTSTR lptszFile = strconv.w2t((LPWSTR)pszFile); LPCTSTR lptszDestFile = strconv.w2t((LPWSTR)pszDestFile); LPCTSTR lptszDesc = strconv.w2t((LPWSTR)pszDesc); int nAddResult = pCrashHandler->AddFile(lptszFile, lptszDestFile, lptszDesc, dwFlags); if(nAddResult!=0) { // Couldn't add file return 2; } // OK. return 0; }
CRASHRPTAPI void AddFileEx(LPVOID lpState, LPCTSTR lpFile, LPCTSTR lpDesc) { CCrashHandler *pImpl = (CCrashHandler*)lpState; CRASH_ASSERT(pImpl); pImpl->AddFile(lpFile, lpDesc); }