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

Unified Diff: chrome_frame/exception_barrier_lowlevel.asm

Issue 1733021: Add an ExceptionBarrier around outbound calls to patched methods in IE. In so... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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
Index: chrome_frame/exception_barrier_lowlevel.asm
===================================================================
--- chrome_frame/exception_barrier_lowlevel.asm (revision 0)
+++ chrome_frame/exception_barrier_lowlevel.asm (revision 0)
@@ -0,0 +1,52 @@
+; Copyright (c) 2010 The Chromium Authors. All rights reserved.
+; Use of this source code is governed by a BSD-style license that can be
+; found in the LICENSE file.
+;
+; Tag the exception handler as an SEH handler in case the executable
+; is linked with /SAFESEH (which is the default).
+;
+; MASM 8.0 inserts an additional leading underscore in front of names
+; and this is an attempted fix until we understand why.
+IF @version LT 800
+_ExceptionBarrierHandler PROTO
+.SAFESEH _ExceptionBarrierHandler
+ELSE
+ExceptionBarrierHandler PROTO
+.SAFESEH ExceptionBarrierHandler
+ENDIF
+
+.586
+.MODEL FLAT, STDCALL
+ASSUME FS:NOTHING
+.CODE
+
+; extern "C" void WINAPI RegisterExceptionRecord(
+; EXCEPTION_REGISTRATION *registration,
+; ExceptionHandlerFunc func);
+RegisterExceptionRecord PROC registration:DWORD, func:DWORD
+OPTION PROLOGUE:None
+OPTION EPILOGUE:None
+ mov edx, DWORD PTR [esp + 4] ; edx is registration
+ mov eax, DWORD PTR [esp + 8] ; eax is func
+ mov DWORD PTR [edx + 4], eax
+ mov eax, FS:[0]
+ mov DWORD PTR [edx], eax
+ mov FS:[0], edx
+ ret 8
+
+RegisterExceptionRecord ENDP
+
+; extern "C" void UnregisterExceptionRecord(
+; EXCEPTION_REGISTRATION *registration);
+UnregisterExceptionRecord PROC registration:DWORD
+OPTION PROLOGUE:None
+OPTION EPILOGUE:None
+
+ mov edx, DWORD PTR [esp + 4]
+ mov eax, [edx]
+ mov FS:[0], eax
+ ret 4
+
+UnregisterExceptionRecord ENDP
+
+END
Property changes on: chrome_frame\exception_barrier_lowlevel.asm
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698