- Timestamp:
- Apr 21, 2001, 11:10:14 AM (24 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/exceptions.cpp
r5308 r5557 1 /* $Id: exceptions.cpp,v 1.51 2001-03-13 18:45:33 sandervl Exp $ */ 2 3 /* WARNING: Compiling this module with ICC with optimizations turned on */ 4 /* currently breaks this module. To get correct code, it is not necessary */ 5 /* to turn all optimizations off, just use the -Op- flag. */ 1 /* $Id: exceptions.cpp,v 1.52 2001-04-21 09:10:13 sandervl Exp $ */ 6 2 7 3 /* … … 126 122 } 127 123 124 #if 0 128 125 static inline WINEXCEPTION_FRAME * EXC_push_frame( WINEXCEPTION_FRAME *frame ) 129 126 { … … 142 139 return frame->Prev; 143 140 } 141 #endif 144 142 145 143 /***************************************************************************** … … 270 268 } 271 269 270 #if 1 271 DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame, 272 WINCONTEXT *context, WINEXCEPTION_FRAME **dispatcher, 273 PEXCEPTION_HANDLER handler, PEXCEPTION_HANDLER nested_handler); 274 275 #else 272 276 /******************************************************************* 273 277 * EXC_CallHandler … … 296 300 return ret; 297 301 } 298 302 #endif 299 303 //****************************************************************************** 300 304 //****************************************************************************** -
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 -
trunk/src/kernel32/hmstd.cpp
r5303 r5557 1 /* $Id: hmstd.cpp,v 1. 2 2001-03-12 14:16:33sandervl Exp $ */1 /* $Id: hmstd.cpp,v 1.3 2001-04-21 09:10:14 sandervl Exp $ */ 2 2 3 3 /* … … 152 152 LPOVERLAPPED lpOverlapped) 153 153 { 154 DWORD byteswritten; 154 DWORD byteswritten; 155 LPVOID lpLowMemBuffer; 155 156 156 157 dprintf2(("KERNEL32: HMDeviceStandardClass::WriteFile %s(%08x,%08x,%08x,%08x,%08x) - stub?\n", … … 167 168 return FALSE; 168 169 } 169 return O32_WriteFile(pHMHandleData->hHMHandle, lpBuffer, nNumberOfBytesToWrite, 170 lpNumberOfBytesWritten, lpOverlapped); 170 lpLowMemBuffer = alloca(nNumberOfBytesToWrite); 171 if(lpLowMemBuffer == NULL) { 172 DebugInt3(); 173 return FALSE; 174 } 175 memcpy(lpLowMemBuffer, lpBuffer, nNumberOfBytesToWrite); 176 return O32_WriteFile(pHMHandleData->hHMHandle, lpLowMemBuffer, nNumberOfBytesToWrite, 177 lpNumberOfBytesWritten, lpOverlapped); 171 178 } 172 179 -
trunk/src/kernel32/kernel32.mak
r5471 r5557 1 # $Id: kernel32.mak,v 1. 2 2001-04-04 09:00:58sandervl Exp $1 # $Id: kernel32.mak,v 1.3 2001-04-21 09:10:14 sandervl Exp $ 2 2 3 3 # … … 149 149 # 150 150 !include $(ODIN32_POST_INC) 151 152 153 #154 # Override flags for exceptions.cpp155 # Hmm. This is compiler depended!156 #157 $(OBJDIR)\exceptions.obj: exceptions.cpp158 !if "$(VAC3)" == "1" || "$(VAC36)" == "1"159 $(CXX) $(CXXFLAGS) $(CINCLUDES) $(CDEFINES) -O- \160 -Fo$(OBJDIR)\$(@B).obj -c exceptions.cpp161 !else162 # Since this only turns off stack optimizations I take it's a VAC only fix.163 # -kso (2001-02-17)164 # ! error "Compiler is not supported yet."165 !endif166
Note:
See TracChangeset
for help on using the changeset viewer.