Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: base/threading/platform_thread_win.cc

Issue 7606016: Added code to verify whether TerminateProcess is hooked before calling it. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_win.cc
===================================================================
--- base/threading/platform_thread_win.cc (revision 96009)
+++ base/threading/platform_thread_win.cc (working copy)
@@ -4,6 +4,7 @@
#include "base/threading/platform_thread.h"
+#include "base/debug/alias.h"
#include "base/logging.h"
#include "base/threading/thread_local.h"
#include "base/threading/thread_restrictions.h"
@@ -33,6 +34,14 @@
};
DWORD __stdcall ThreadFunc(void* params) {
+ // TODO(apatrick): Remove this ASAP. This ensures that if the
+ // TerminateProcess entry point has been patched to point into a third party
+ // DLL, this is visible on the stack and the DLL in question can be
+ // determined.
+ typedef BOOL (WINAPI *TerminateProcessPtr)(HANDLE, UINT);
+ TerminateProcessPtr terminate_process = TerminateProcess;
+ base::debug::Alias(&terminate_process);
+
ThreadParams* thread_params = static_cast<ThreadParams*>(params);
PlatformThread::Delegate* delegate = thread_params->delegate;
if (!thread_params->joinable)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698