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

Unified Diff: remoting/host/win/entry_point.cc

Issue 2621223003: Fix building ASAN instrumented executables with custom entrypoints (Closed)
Patch Set: nits Created 3 years, 11 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 | « remoting/host/win/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/entry_point.cc
diff --git a/remoting/host/win/entry_point.cc b/remoting/host/win/entry_point.cc
index 0d711f27807d54efeece6c29533675cf75759202..a4e1f10a35b70e558ea623fd98ed1d0647372148 100644
--- a/remoting/host/win/entry_point.cc
+++ b/remoting/host/win/entry_point.cc
@@ -14,3 +14,21 @@ void HostEntryPoint() {
int exit_code = remoting::HostMain(0, nullptr);
ExitProcess(exit_code);
}
+
+#if defined(ADDRESS_SANITIZER)
+// Executables instrumented with ASAN need CRT functions. We do not use
+// the /ENTRY switch for ASAN instrumented executable and a "main" function
+// is required.
+int WINAPI wWinMain (HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow) {
+ HostEntryPoint();
+ return 0;
+}
+
+int wmain() {
+ HostEntryPoint();
+ return 0;
+}
+#endif
« no previous file with comments | « remoting/host/win/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698