| OLD | NEW |
| (Empty) |
| 1 ; Copyright 2006-2009 Google Inc. | |
| 2 ; | |
| 3 ; Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 ; you may not use this file except in compliance with the License. | |
| 5 ; You may obtain a copy of the License at | |
| 6 ; | |
| 7 ; http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 ; | |
| 9 ; Unless required by applicable law or agreed to in writing, software | |
| 10 ; distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 ; See the License for the specific language governing permissions and | |
| 13 ; limitations under the License. | |
| 14 ; ======================================================================== | |
| 15 ; | |
| 16 ; Tag the exception handler as an SEH handler in case the executable | |
| 17 ; is linked with /SAFESEH (which is the default). | |
| 18 ; | |
| 19 ; MASM 8.0 inserts an additional leading underscore in front of names | |
| 20 ; and this is an attempted fix until we understand why. | |
| 21 IF @version LT 800 | |
| 22 _ExceptionBarrierHandler PROTO | |
| 23 .SAFESEH _ExceptionBarrierHandler | |
| 24 ELSE | |
| 25 ExceptionBarrierHandler PROTO | |
| 26 .SAFESEH ExceptionBarrierHandler | |
| 27 ENDIF | |
| 28 | |
| 29 .586 | |
| 30 .MODEL FLAT, STDCALL | |
| 31 ASSUME FS:NOTHING | |
| 32 .CODE | |
| 33 | |
| 34 ; extern "C" void WINAPI RegisterExceptionRecord( | |
| 35 ; EXCEPTION_REGISTRATION *registration, | |
| 36 ; ExceptionHandlerFunc func); | |
| 37 RegisterExceptionRecord PROC registration:DWORD, func:DWORD | |
| 38 OPTION PROLOGUE:None | |
| 39 OPTION EPILOGUE:None | |
| 40 mov edx, DWORD PTR [esp + 4] ; edx is registration | |
| 41 mov eax, DWORD PTR [esp + 8] ; eax is func | |
| 42 mov DWORD PTR [edx + 4], eax | |
| 43 mov eax, FS:[0] | |
| 44 mov DWORD PTR [edx], eax | |
| 45 mov FS:[0], edx | |
| 46 ret 8 | |
| 47 | |
| 48 RegisterExceptionRecord ENDP | |
| 49 | |
| 50 ; extern "C" void UnregisterExceptionRecord( | |
| 51 ; EXCEPTION_REGISTRATION *registration); | |
| 52 UnregisterExceptionRecord PROC registration:DWORD | |
| 53 OPTION PROLOGUE:None | |
| 54 OPTION EPILOGUE:None | |
| 55 | |
| 56 mov edx, DWORD PTR [esp + 4] | |
| 57 mov eax, [edx] | |
| 58 mov FS:[0], eax | |
| 59 ret 4 | |
| 60 | |
| 61 UnregisterExceptionRecord ENDP | |
| 62 | |
| 63 END | |
| OLD | NEW |