summaryrefslogtreecommitdiff
path: root/plugins/CrashDumper/src/exhndlr.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-22 17:14:55 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-22 17:14:55 +0000
commitd8967087af559a43f1801e3e89411d570cbb3110 (patch)
treeb6596526a66c1aa8b80bab769cc7fd5472b327a8 /plugins/CrashDumper/src/exhndlr.cpp
parentd867e44172947b51b34d60a672673dffd771a304 (diff)
plugins cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6185 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper/src/exhndlr.cpp')
-rw-r--r--plugins/CrashDumper/src/exhndlr.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp
index cee6cb283c..305172a7c8 100644
--- a/plugins/CrashDumper/src/exhndlr.cpp
+++ b/plugins/CrashDumper/src/exhndlr.cpp
@@ -8,23 +8,15 @@ static PVOID exchndlr, exchndlrv;
static pfnExceptionFilter threadfltr;
static PEXCEPTION_POINTERS lastptr;
-static HMODULE hKernel = GetModuleHandle(TEXT("kernel32.dll"));
-
-tAddVectoredExceptionHandler pAddVectoredExceptionHandler = (tAddVectoredExceptionHandler)GetProcAddress(hKernel, "AddVectoredExceptionHandler");
-tRemoveVectoredExceptionHandler pRemoveVectoredExceptionHandler = (tRemoveVectoredExceptionHandler)GetProcAddress(hKernel, "RemoveVectoredExceptionHandler");
-tRtlCaptureContext pRtlCaptureContext = (tRtlCaptureContext)GetProcAddress(hKernel, "RtlCaptureContext");
-
void SetExceptionHandler(void)
{
-// if (pAddVectoredExceptionHandler && !exchndlrv)
-// exchndlrv = pAddVectoredExceptionHandler(0, myfilterv);
exchndlr = SetUnhandledExceptionFilter(myfilter);
}
void RemoveExceptionHandler(void)
{
- if (pRemoveVectoredExceptionHandler && exchndlrv)
- pRemoveVectoredExceptionHandler(exchndlrv);
+ if (exchndlrv)
+ RemoveVectoredExceptionHandler(exchndlrv);
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)exchndlr);
exchndlr = NULL;
exchndlrv = NULL;
@@ -163,13 +155,7 @@ void InvalidParameterHandler(const wchar_t*, const wchar_t*, const wchar_t*, uns
CONTEXT ContextRecord = {0};
EXCEPTION_POINTERS info = { &ExceptionRecord, &ContextRecord };
- if (pRtlCaptureContext)
- pRtlCaptureContext(&ContextRecord);
- else
- {
- ContextRecord.ContextFlags = CONTEXT_ALL;
- GetThreadContext(GetCurrentThread(), &ContextRecord);
- }
+ RtlCaptureContext(&ContextRecord);
#if defined(_AMD64_)
ExceptionRecord.ExceptionAddress = (PVOID)ContextRecord.Rip;