From f86885ec3911bacc2d540eb3d61e599c9f51bf53 Mon Sep 17 00:00:00 2001 From: Soreepeong Date: Mon, 5 Sep 2022 10:18:53 +0900 Subject: [PATCH] actually make --veh-full work --- DalamudCrashHandler/DalamudCrashHandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DalamudCrashHandler/DalamudCrashHandler.cpp b/DalamudCrashHandler/DalamudCrashHandler.cpp index e6ca46fe6..5894baf3c 100644 --- a/DalamudCrashHandler/DalamudCrashHandler.cpp +++ b/DalamudCrashHandler/DalamudCrashHandler.cpp @@ -432,6 +432,7 @@ int main() { HANDLE hPipeRead = nullptr; std::filesystem::path assetDir, logDir; std::optional> launcherArgs; + auto fullDump = false; std::vector args; if (int argc = 0; const auto argv = CommandLineToArgvW(GetCommandLineW(), &argc)) { @@ -451,6 +452,8 @@ int main() { assetDir = arg.substr(ARRAYSIZE(pwszArgPrefix) - 1); } else if (constexpr wchar_t pwszArgPrefix[] = L"--log-directory="; arg.starts_with(pwszArgPrefix)) { logDir = arg.substr(ARRAYSIZE(pwszArgPrefix) - 1); + } else if (arg == L"--veh-full") { + fullDump = true; } else if (arg == L"--") { launcherArgs.emplace(); } else { @@ -544,7 +547,7 @@ int main() { } std::unique_ptr, decltype(&CloseHandle)> hDumpFilePtr(hDumpFile, &CloseHandle); - if (!MiniDumpWriteDump(g_hProcess, dwProcessId, hDumpFile, static_cast(MiniDumpWithDataSegs | MiniDumpWithModuleHeaders), &mdmp_info, nullptr, nullptr)) { + if (!MiniDumpWriteDump(g_hProcess, dwProcessId, hDumpFile, fullDump ? MiniDumpWithFullMemory : static_cast(MiniDumpWithDataSegs | MiniDumpWithModuleHeaders), &mdmp_info, nullptr, nullptr)) { std::wcerr << (dumpError = std::format(L"MiniDumpWriteDump(0x{:x}, {}, 0x{:x}({}), MiniDumpWithFullMemory, ..., nullptr, nullptr) error: 0x{:x}", reinterpret_cast(g_hProcess), dwProcessId, reinterpret_cast(hDumpFile), dumpPath.wstring(), GetLastError())) << std::endl; break; }