From cd1d135a87fe52e5b802d5088f3cd17909e53ac3 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 21 Sep 2021 09:29:54 -0400 Subject: [PATCH] Remove DalamudDebugStub --- DalamudDebugStub/DalamudDebugStub.vcxproj | 173 ------------------ .../DalamudDebugStub.vcxproj.filters | 33 ---- DalamudDebugStub/dllmain.cpp | 118 ------------ DalamudDebugStub/framework.h | 5 - DalamudDebugStub/pch.cpp | 5 - DalamudDebugStub/pch.h | 13 -- 6 files changed, 347 deletions(-) delete mode 100644 DalamudDebugStub/DalamudDebugStub.vcxproj delete mode 100644 DalamudDebugStub/DalamudDebugStub.vcxproj.filters delete mode 100644 DalamudDebugStub/dllmain.cpp delete mode 100644 DalamudDebugStub/framework.h delete mode 100644 DalamudDebugStub/pch.cpp delete mode 100644 DalamudDebugStub/pch.h diff --git a/DalamudDebugStub/DalamudDebugStub.vcxproj b/DalamudDebugStub/DalamudDebugStub.vcxproj deleted file mode 100644 index 4755bf877..000000000 --- a/DalamudDebugStub/DalamudDebugStub.vcxproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {9FDA9A5C-50C6-4333-8DCE-DFEB89363F2A} - Win32Proj - DalamudDebugStub - 10.0 - - - - DynamicLibrary - true - v142 - Unicode - - - DynamicLibrary - false - v142 - true - Unicode - - - DynamicLibrary - true - v142 - Unicode - - - DynamicLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - $(SolutionDir)bin\ - - - false - - - false - $(SolutionDir)bin\ - - - - Use - Level3 - true - WIN32;_DEBUG;DALAMUDDEBUGSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - - - Windows - true - false - - - - - Use - Level3 - true - _DEBUG;DALAMUDDEBUGSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - - - Windows - true - false - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;dbghelp.lib;%(AdditionalDependencies) - - - - - Use - Level3 - true - true - true - WIN32;NDEBUG;DALAMUDDEBUGSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - - - Windows - true - true - true - false - - - - - Use - Level3 - true - true - true - NDEBUG;DALAMUDDEBUGSTUB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - - - Windows - true - true - true - false - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;dbghelp.lib;%(AdditionalDependencies) - - - - - - - - - - Create - Create - Create - Create - - - - - - \ No newline at end of file diff --git a/DalamudDebugStub/DalamudDebugStub.vcxproj.filters b/DalamudDebugStub/DalamudDebugStub.vcxproj.filters deleted file mode 100644 index d4f9881b8..000000000 --- a/DalamudDebugStub/DalamudDebugStub.vcxproj.filters +++ /dev/null @@ -1,33 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/DalamudDebugStub/dllmain.cpp b/DalamudDebugStub/dllmain.cpp deleted file mode 100644 index 37e475bd1..000000000 --- a/DalamudDebugStub/dllmain.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// dllmain.cpp : Defines the entry point for the DLL application. -#include "pch.h" - -#include -#include -#include -#include - -bool isExcept = false; - -LONG WINAPI -VectoredHandler( - struct _EXCEPTION_POINTERS* ExceptionInfo -) -{ - PEXCEPTION_RECORD Record = ExceptionInfo->ExceptionRecord; - - if (Record->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) - return EXCEPTION_CONTINUE_SEARCH; - - //ListProcessThreads(GetCurrentProcessId()); - - if (!isExcept) - { - isExcept = true; - - TCHAR pszMessage[1024] = { 0 }; - _stprintf_s(pszMessage, _T("An internal error in Dalamud or a FFXIV plugin occured.\nThe game must close.\n\nDo you wish to save troubleshooting information?\n\nReasoning: 0x%x at 0x%x"), Record->ExceptionCode, Record->ExceptionAddress); - - auto res = MessageBox(NULL, pszMessage, L"Dalamud", MB_YESNO | MB_ICONERROR | MB_TOPMOST); - - if (res == IDYES) - { - TCHAR fileName[255] = { 0 }; - - char* pValue; - size_t len; - errno_t err = _dupenv_s(&pValue, &len, "APPDATA"); - - wchar_t* fullPath = new wchar_t[2048]; - - // Convert char* string to a wchar_t* string. - size_t convertedChars = 0; - mbstowcs_s(&convertedChars, fullPath, strlen(pValue) + 1, pValue, _TRUNCATE); - - SYSTEMTIME t; - GetSystemTime(&t); - _stprintf_s(fileName, _T("MD-%d-%d-%d-%d-%d-%d.dmp"), t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond); - - _tcscat_s(fullPath, 2048, TEXT("\\XIVLauncher\\")); - _tcscat_s(fullPath, 2048, fileName); - - HANDLE hFile = CreateFileW(fullPath, GENERIC_READ | GENERIC_WRITE, - 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - - if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE)) - { - // Create the minidump - - MINIDUMP_EXCEPTION_INFORMATION mdei; - - mdei.ThreadId = GetCurrentThreadId(); - mdei.ExceptionPointers = ExceptionInfo; - mdei.ClientPointers = TRUE; - - BOOL rv = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), - hFile, (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithDataSegs | MiniDumpWithThreadInfo), (ExceptionInfo != 0) ? &mdei : 0, 0, 0); - - if (!rv) - _stprintf_s(pszMessage, _T("MiniDumpWriteDump failed. Error: %u \n"), GetLastError()); - else - _stprintf_s(pszMessage, _T("Minidump created.\n")); - - MessageBox(NULL, pszMessage, L"Dalamud", MB_OK | MB_ICONINFORMATION | MB_TOPMOST); - - // Close the file - - CloseHandle(hFile); - } - else - { - _tprintf(_T("CreateFile failed. Error: %u \n"), GetLastError()); - } - } - - exit(-1); - } - - PCONTEXT Context; - - Context = ExceptionInfo->ContextRecord; -#ifdef _AMD64_ - Context->Rip++; -#else - Context->Eip++; -#endif - return EXCEPTION_CONTINUE_EXECUTION; -} - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved -) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - - AddVectoredExceptionHandler(99, VectoredHandler); - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/DalamudDebugStub/framework.h b/DalamudDebugStub/framework.h deleted file mode 100644 index 54b83e94f..000000000 --- a/DalamudDebugStub/framework.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files -#include diff --git a/DalamudDebugStub/pch.cpp b/DalamudDebugStub/pch.cpp deleted file mode 100644 index 64b7eef6d..000000000 --- a/DalamudDebugStub/pch.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// pch.cpp: source file corresponding to the pre-compiled header - -#include "pch.h" - -// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/DalamudDebugStub/pch.h b/DalamudDebugStub/pch.h deleted file mode 100644 index 885d5d62e..000000000 --- a/DalamudDebugStub/pch.h +++ /dev/null @@ -1,13 +0,0 @@ -// pch.h: This is a precompiled header file. -// Files listed below are compiled only once, improving build performance for future builds. -// This also affects IntelliSense performance, including code completion and many code browsing features. -// However, files listed here are ALL re-compiled if any one of them is updated between builds. -// Do not add files here that you will be updating frequently as this negates the performance advantage. - -#ifndef PCH_H -#define PCH_H - -// add headers that you want to pre-compile here -#include "framework.h" - -#endif //PCH_H