1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/loader/signal.c
Alexandre Julliard e399fc3636 Release 0.4.10
Mon Nov 22 13:58:56 1993  David Metcalfe <david@prism.demon.co.uk>

        * [windows/scroll.c]
	Preliminary implementations of ScrollWindow, ScrollDC and
        ScrollWindowEx.

Nov 21, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [controls/listbox.c]
	Optimization of redraw during 'Add' or 'Insert'.

	* [controls/scroll.c]
	Optimization of WM_PAINT during 'thumbtracking'.

	* [controls/button.c]
	Add of beta implement of 'BS_OWNERDRAW'

	* [controls/static.c]
	Style 'SS_ICON' new supported.

	* [misc/message.c]
	Begin of implemantation of MB_XXX styles.

	* [loader/resource.c]
	Function LoadIcon() : now prepare transparency Bitmap mask.
	Function LoadCursor() : now prepare a 'X pixmapcursor'.
	New function SetCursor() : not finished.
	New function ShowCursor() : not finished.
	New function AccessResource() : stub.

	* [obj/dib.c]
	Function DrawIcon(): deugging phase of icon transparency mask.

	* [loader/library.c]
	new file for news functions LoadLibrary() & FreeLibrary().

	* [sysres.dll]
	Resources only 16bits DLL for System Resources, icons, etc...

Sun Nov 14 14:39:06 1993  julliard@di.epfl.ch (Alexandre Julliard)

	* [include/dialog.h] [windows/dialog.c]
	Simplified dialog template parsing.
	Implemented DialogBoxIndirect().

	* [windows/win.c]
	Fixed bug in CreateWindow() when aborting window creation.
	Modified UpdateWindow() to only update visible windows.
	Implemented IsWindow().

Nov 14, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [controls/listbox.c]
	Listbox control window : new messages.

	* [controls/combo.c]
	Combo box control window : new messages.

	* [misc/message.c]
	Moved stub MessageBox() to this new file.
	Implemented of a callback, now MessageBox show a window.

	* [loader/resource.c]
	New function DestroyIcon()
	New function DestroyCursor()
	Filled stub LoadIcon()
	Filled stub LoadCursor()
	Bug fixed in FindResourceByName() : missing lseek().

	* [obj/dib.c]
	New function DrawIcon()

	* [windows/win.c]
	New function CloseWindow()
	New function OpenIcon()
	New function IsIconic()
	New Function FindWindow()

Sun Nov 14 08:27:19 1993  Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)

	* [loader/selector.c]
	Wrote AllocCStoDSAlias() and AllocDStoCSAlias()

Sun Nov 14 08:27:19 1993  Bob Amstadt  (bob at amscons)

	* [loader/selector.c]
	Wrote AllocSelector() and PrestoChangoSelector().  YUK!

Sat Nov 13 13:56:42 1993  Bob Amstadt  (bob at amscons)

	* [loader/resource.c]
	Wrote FindResource(), LoadResource(), LockResource(),
	and FreeResource()

	* [include/segmem.h] [loader/selector.c] [loader/signal.h]
	Changed selector allocation method.

Sun Nov 10 08:27:19 1993  Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)

	* [if1632/callback.c if1632/call.S if1632/user.spec] 
	added Catch (KERNEL.55) and Throw (KERNEL.56)
	
Nov 7, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [controls/scroll.c]
	Scroll bar control window
		Bug resolved : Painting message before scroll visible.

	* [controls/listbox.c]
	Listbox control window
		Destroy cleanup.

	* [controls/combo.c]
	Combo box control window
		Destroy cleanup.

	* [controls/button.c]
		GetCheck Message now return is state.

	* [windows/win.c]
	New function IsWindowVisible()
1993-11-24 17:08:56 +00:00

153 lines
3.5 KiB
C

#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <syscall.h>
#include <signal.h>
#include <errno.h>
#ifdef linux
#include <linux/sched.h>
#include <asm/system.h>
#endif
#include "wine.h"
#include "segmem.h"
char * cstack[4096];
struct sigaction segv_act;
#ifdef linux
extern void ___sig_restore();
extern void ___masksig_restore();
#endif
/* Similar to the sigaction function in libc, except it leaves alone the
restorer field */
static int
wine_sigaction(int sig,struct sigaction * new, struct sigaction * old)
{
__asm__("int $0x80":"=a" (sig)
:"0" (SYS_sigaction),"b" (sig),"c" (new),"d" (old));
if (sig>=0)
return 0;
errno = -sig;
return -1;
}
#ifdef linux
static void win_fault(int signal, struct sigcontext_struct context){
struct sigcontext_struct *scp = &context;
#else
static void win_fault(int signal, int code, struct sigcontext *scp){
#endif
unsigned char * instr;
unsigned char intno;
unsigned int * dump;
int i;
/* First take care of a few preliminaries */
#ifdef linux
if(signal != SIGSEGV) exit(1);
if((scp->sc_cs & 7) != 7){
#endif
#ifdef __NetBSD__
/* set_es(0x27); set_ds(0x27); */
if(signal != SIGBUS) exit(1);
if(scp->sc_cs == 0x1f){
#endif
fprintf(stderr,
"Segmentation fault in Wine program (%x:%x)."
" Please debug\n",
scp->sc_cs, scp->sc_eip);
goto oops;
};
/* Now take a look at the actual instruction where the program
bombed */
instr = (char *) SAFEMAKEPTR(scp->sc_cs, scp->sc_eip);
if(*instr != 0xcd) {
fprintf(stderr,
"Unexpected Windows program segfault"
" - opcode = %x\n", *instr);
#if 0
return;
#else
goto oops;
#endif
};
instr++;
intno = *instr;
switch(intno){
case 0x21:
if(!do_int21(scp)) goto oops;
break;
case 0x11:
scp->sc_eax = 0x00000000; /* get equipment list: we haven't */
break; /* got anything */
case 0x12:
scp->sc_eax = 640L; /* get base mem size */
break;
case 0x1A:
if(!do_int1A(scp)) goto oops;
break;
default:
fprintf(stderr,"Unexpected Windows interrupt %x\n", intno);
goto oops;
};
/* OK, done handling the interrupt */
scp->sc_eip += 2; /* Bypass the int instruction */
return;
oops:
fprintf(stderr,"In win_fault %x:%x\n", scp->sc_cs, scp->sc_eip);
#ifdef linux
wine_debug(scp); /* Enter our debugger */
#else
fprintf(stderr,"Stack: %x:%x\n", scp->sc_ss, scp->sc_esp);
dump = (int*) scp;
for(i=0; i<22; i++)
{
fprintf(stderr," %8.8x", *dump++);
if ((i % 8) == 7)
fprintf(stderr,"\n");
}
fprintf(stderr,"\n");
exit(1);
#endif
}
int
init_wine_signals(){
#ifdef linux
segv_act.sa_handler = (__sighandler_t) win_fault;
/* Point to the top of the stack, minus 4 just in case, and make
it aligned */
segv_act.sa_restorer =
(void (*)()) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
wine_sigaction(SIGSEGV, &segv_act, NULL);
#endif
#ifdef __NetBSD__
struct sigstack ss;
sigset_t sig_mask;
ss.ss_sp = (char *) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
ss.ss_onstack = 0;
if (sigstack(&ss, NULL) < 0) {
perror("sigstack");
exit(1);
}
sigemptyset(&sig_mask);
segv_act.sa_handler = (__sighandler_t) win_fault;
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGBUS, &segv_act, NULL) < 0) {
perror("sigaction");
exit(1);
}
#endif
}