OLD | NEW |
(Empty) | |
| 1 ; Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 ; Use of this source code is governed by a BSD-style license that can be |
| 3 ; found in the LICENSE file. |
| 4 ; |
| 5 ; Tag the exception handler as an SEH handler in case the executable |
| 6 ; is linked with /SAFESEH (which is the default). |
| 7 ; |
| 8 ; MASM 8.0 inserts an additional leading underscore in front of names |
| 9 ; and this is an attempted fix until we understand why. |
| 10 IF @version LT 800 |
| 11 _ExceptionBarrierHandler PROTO |
| 12 .SAFESEH _ExceptionBarrierHandler |
| 13 ELSE |
| 14 ExceptionBarrierHandler PROTO |
| 15 .SAFESEH ExceptionBarrierHandler |
| 16 ENDIF |
| 17 |
| 18 .586 |
| 19 .MODEL FLAT, STDCALL |
| 20 ASSUME FS:NOTHING |
| 21 .CODE |
| 22 |
| 23 ; extern "C" void WINAPI RegisterExceptionRecord( |
| 24 ; EXCEPTION_REGISTRATION *registration, |
| 25 ; ExceptionHandlerFunc func); |
| 26 RegisterExceptionRecord PROC registration:DWORD, func:DWORD |
| 27 OPTION PROLOGUE:None |
| 28 OPTION EPILOGUE:None |
| 29 mov edx, DWORD PTR [esp + 4] ; edx is registration |
| 30 mov eax, DWORD PTR [esp + 8] ; eax is func |
| 31 mov DWORD PTR [edx + 4], eax |
| 32 mov eax, FS:[0] |
| 33 mov DWORD PTR [edx], eax |
| 34 mov FS:[0], edx |
| 35 ret 8 |
| 36 |
| 37 RegisterExceptionRecord ENDP |
| 38 |
| 39 ; extern "C" void UnregisterExceptionRecord( |
| 40 ; EXCEPTION_REGISTRATION *registration); |
| 41 UnregisterExceptionRecord PROC registration:DWORD |
| 42 OPTION PROLOGUE:None |
| 43 OPTION EPILOGUE:None |
| 44 |
| 45 mov edx, DWORD PTR [esp + 4] |
| 46 mov eax, [edx] |
| 47 mov FS:[0], eax |
| 48 ret 4 |
| 49 |
| 50 UnregisterExceptionRecord ENDP |
| 51 |
| 52 END |
OLD | NEW |