Changeset 5557 for trunk/src/kernel32/exceptutil.asm
- Timestamp:
- Apr 21, 2001, 11:10:14 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/exceptutil.asm
r5378 r5557 1 ; $Id: exceptutil.asm,v 1.1 4 2001-03-25 22:05:36sandervl Exp $1 ; $Id: exceptutil.asm,v 1.15 2001-04-21 09:10:14 sandervl Exp $ 2 2 3 3 ;/* … … 10 10 .386p 11 11 NAME except 12 13 DATA32 segment dword use32 public 'DATA' 14 DATA32 ends 15 CONST32_RO segment dword use32 public 'CONST' 16 CONST32_RO ends 17 BSS32 segment dword use32 public 'BSS' 18 BSS32 ends 19 EH_CODE segment dword use32 public 'CODE' 20 EH_CODE ends 21 CTOR_DTOR1 segment dword use32 public 'DATA' 22 CTOR_DTOR1 ends 23 CTOR_DTOR2 segment dword use32 public 'DATA' 24 CTOR_DTOR2 ends 25 CTOR_DTOR3 segment dword use32 public 'DATA' 26 CTOR_DTOR3 ends 27 EH_DATA segment para use32 public 'DATA' 28 EH_DATA ends 29 _VFT segment para use32 public 'DATA' 30 _VFT ends 31 DGROUP group BSS32, DATA32 32 assume cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT 33 34 DATA32 segment dword use32 public 'DATA' 35 36 CONST32_RO segment 37 align 04h 38 @CBE8 db "KERNEL32: Calling handle" 39 db "r at %p code=%lx flags=%" 40 db "lx",0ah,0h 41 @CBE9 db "KERNEL32: Handler return" 42 db "ed %lx",0ah,0h 43 CONST32_RO ends 44 DATA32 ends 12 45 13 46 CODE32 SEGMENT DWORD PUBLIC USE32 'CODE' … … 246 279 _AsmCallThreadHandler endp 247 280 281 ; 281 static DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame, 282 EXTRN WriteLog:PROC 283 EXTRN _GetThreadTEB@0:PROC 284 IFDEF DEBUG 285 EXTRN DbgEnabled:DWORD 286 ENDIF 287 288 EXC_push_frame__FP19_WINEXCEPTION_FRAME proc 289 push ebp 290 mov ebp,esp 291 sub esp,04h 292 mov [ebp+08h],eax; frame 293 294 ; 132 TEB *teb = GetThreadTEB(); 295 call _GetThreadTEB@0 296 mov [ebp-04h],eax; teb 297 298 ; 133 frame->Prev = (PWINEXCEPTION_FRAME)teb->except; 299 mov ecx,[ebp-04h]; teb 300 mov ecx,[ecx] 301 mov eax,[ebp+08h]; frame 302 mov [eax],ecx 303 304 ; 134 teb->except = frame; 305 mov eax,[ebp-04h]; teb 306 mov ecx,[ebp+08h]; frame 307 mov [eax],ecx 308 309 ; 135 return frame->Prev; 310 mov eax,[ebp+08h]; frame 311 mov eax,[eax] 312 leave 313 ret 314 EXC_push_frame__FP19_WINEXCEPTION_FRAME endp 315 316 ; 138 static inline WINEXCEPTION_FRAME * EXC_pop_frame( WINEXCEPTION_FRAME *frame ) 317 align 04h 318 319 EXC_pop_frame__FP19_WINEXCEPTION_FRAME proc 320 push ebp 321 mov ebp,esp 322 sub esp,04h 323 mov [ebp+08h],eax; frame 324 325 ; 141 TEB *teb = GetThreadTEB(); 326 call _GetThreadTEB@0 327 mov [ebp-04h],eax; teb 328 329 ; 142 teb->except = frame->Prev; 330 mov ecx,[ebp+08h]; frame 331 mov ecx,[ecx] 332 mov eax,[ebp-04h]; teb 333 mov [eax],ecx 334 335 ; 143 return frame->Prev; 336 mov eax,[ebp+08h]; frame 337 mov eax,[eax] 338 leave 339 ret 340 EXC_pop_frame__FP19_WINEXCEPTION_FRAME endp 341 342 align 04h 343 PUBLIC EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5 344 345 EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5 proc 346 push ebp 347 mov ebp,esp 348 sub esp,010h 349 sub esp,04h 350 mov [ebp+08h],eax; record 351 mov [ebp+0ch],edx; frame 352 mov [ebp+010h],ecx; context 353 354 ; 296 newframe.frame.Handler = nested_handler; 355 mov eax,[ebp+01ch]; nested_handler 356 mov [ebp-08h],eax; newframe 357 358 ; 297 newframe.prevFrame = frame; 359 mov eax,[ebp+0ch]; frame 360 mov [ebp-04h],eax; newframe 361 362 ; 298 EXC_push_frame( &newframe.frame ); 363 lea eax,[ebp-0ch]; newframe 364 call EXC_push_frame__FP19_WINEXCEPTION_FRAME 365 366 ; 299 dprintf(("KERNEL32: Calling handler at %p code=%lx flags=%lx\n", 367 IFDEF DEBUG 368 cmp word ptr DbgEnabled+020h,01h 369 jne @BLBL20 370 mov eax,[ebp+08h]; record 371 push dword ptr [eax+04h] 372 mov eax,[ebp+08h]; record 373 push dword ptr [eax] 374 push dword ptr [ebp+018h]; handler 375 push offset FLAT:@CBE8 376 call WriteLog 377 add esp,010h 378 ENDIF 379 380 ; 300 handler, record->ExceptionCode, record->ExceptionFlags)); 381 @BLBL20: 382 383 ; 301 ret = handler( record, frame, context, dispatcher ); 384 push dword ptr [ebp+014h]; dispatcher 385 push dword ptr [ebp+010h]; context 386 push dword ptr [ebp+0ch]; frame 387 push dword ptr [ebp+08h]; record 388 call dword ptr [ebp+018h]; handler 389 mov [ebp-010h],eax; ret 390 391 IFDEF DEBUG 392 ; 302 dprintf(("KERNEL32: Handler returned %lx\n", ret)); 393 cmp word ptr DbgEnabled+020h,01h 394 jne @BLBL21 395 push dword ptr [ebp-010h]; ret 396 push offset FLAT:@CBE9 397 call WriteLog 398 add esp,08h 399 @BLBL21: 400 ENDIF 401 402 ; 303 EXC_pop_frame( &newframe.frame ); 403 lea eax,[ebp-0ch]; newframe 404 call EXC_pop_frame__FP19_WINEXCEPTION_FRAME 405 406 ; 304 return ret; 407 mov eax,[ebp-010h]; ret 408 add esp,04h 409 leave 410 ret 411 EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5 endp 412 248 413 CODE32 ENDS 249 414
Note:
See TracChangeset
for help on using the changeset viewer.