MCPcopy Create free account
hub / github.com/DarthTon/Xenos / GenDumpFilenames

Method GenDumpFilenames

src/DumpHandler.cpp:191–218  ·  view source on GitHub ↗

Generate crash dump file names Full dump name Mini dump name true on success

Source from the content-addressed store, hash-verified

189/// <param name="strMiniDump">Mini dump name</param>
190/// <returns>true on success</returns>
191bool DumpHandler::GenDumpFilenames( std::wstring& strFullDump, std::wstring& strMiniDump )
192{
193 wchar_t tFullName[MAX_PATH] = { 0 };
194 wchar_t tMiniName[MAX_PATH] = { 0 };
195 wchar_t tImageName[MAX_PATH] = { 0 };
196
197 SYSTEMTIME time = { 0 };
198
199 // Current time
200 GetLocalTime( &time );
201
202 // Image name
203 GetModuleFileName( NULL, tImageName, ARRAYSIZE( tImageName ) );
204 std::wstring modulename( tImageName );
205 modulename = modulename.substr( modulename.rfind( L"\\" ) + 1 );
206
207 // File name based on current time
208 swprintf_s( tFullName, sizeof( tFullName ) / sizeof( wchar_t ), L"%s\\%s_%d.%.2d.%.2d.%.2d.%.2d.%.2d.dmp",
209 _dumpRoot.c_str(), modulename.c_str(), time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond );
210
211 swprintf_s( tMiniName, sizeof( tFullName ) / sizeof( wchar_t ), L"%s\\%s_%d.%.2d.%.2d.%.2d.%.2d.%.2d.mdmp",
212 _dumpRoot.c_str(), modulename.c_str(), time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond );
213
214 strFullDump = tFullName;
215 strMiniDump = tMiniName;
216
217 return true;
218}
219}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected