Exception Handling

D

deepaksrivastav

Hi,
I am using my own exception handler whose code is as shown below.

struct EXCEPTION_REGISTRATION {
EXCEPTION_REGISTRATION *prev;
DWORD handler;
};

EXCEPTION_DISPOSITION myHandler(_EXCEPTION_RECORD *ExcRecord, void
*EstablisherFrame, _CONTEXT *ContextRecord,void * DispatcherContext)
{
LOG4CPLUS_DEBUG(logger,"Possiblility of a crash");
return ExceptionContinueExecution;
}

i am registering the exception as follows :

void func foo(){

EXCEPTION_REGISTRATION reg, *preg = ®
reg.handler = (DWORD)myHandler;

DWORD prev;
_asm {
mov EAX,FS:[0];
mov prev,EAX;
}

reg.prev = (EXCEPTION_REGISTRATION*)prev;

_asm {
mov EAX,preg;
mov FS:[0],EAX;
}
}


This is actually in a DLL file. After the execution of this function,
the code exits. This code is running on a web server, if there are no
exceptions, it should not exit. Any idea why this is happening?

Regards,
Deepak Srivastav
 
S

Salt_Peter

Hi,
I am using my own exception handler whose code is as shown below.

struct EXCEPTION_REGISTRATION {
EXCEPTION_REGISTRATION *prev;
DWORD handler;

};

EXCEPTION_DISPOSITION myHandler(_EXCEPTION_RECORD *ExcRecord, void
*EstablisherFrame, _CONTEXT *ContextRecord,void * DispatcherContext)
{
LOG4CPLUS_DEBUG(logger,"Possiblility of a crash");
return ExceptionContinueExecution;

}

i am registering the exception as follows :

void func foo(){

EXCEPTION_REGISTRATION reg, *preg = ®
reg.handler = (DWORD)myHandler;

DWORD prev;
_asm {
mov EAX,FS:[0];
mov prev,EAX;
}

reg.prev = (EXCEPTION_REGISTRATION*)prev;

_asm {
mov EAX,preg;
mov FS:[0],EAX;
}

}

This is actually in a DLL file. After the execution of this function,
the code exits. This code is running on a web server, if there are no
exceptions, it should not exit. Any idea why this is happening?

Regards,
Deepak Srivastav


Your question has nothing to do with C++, ask in an appropriate
newsgroup for your language and platform. In this case, you appear to
be using Win32.
 
B

BobR

Hi,
I am using my own exception handler whose code is as shown below.

struct EXCEPTION_REGISTRATION {

Usually, all uppercase names are for macros.
EXCEPTION_REGISTRATION *prev;
DWORD handler;

You have not declared or defined 'DWORD'.
};

EXCEPTION_DISPOSITION myHandler(_EXCEPTION_RECORD

You have not declared or defined 'EXCEPTION_DISPOSITION'.
You have not declared or defined '_EXCEPTION_RECORD'. Also, an underscore
followed by an uppercase letter is reserved by the implementation.
*ExcRecord, void *EstablisherFrame, _CONTEXT *ContextRecord,void *
DispatcherContext)

You have not declared or defined '_CONTEXT'. Ditto the underscore warning.
{
LOG4CPLUS_DEBUG(logger,"Possiblility of a crash");

You have not declared or defined 'LOG4CPLUS_DEBUG'.
(are you starting to get the picture? We need to see all to tell you what
you are doing wrong.)
return ExceptionContinueExecution;

What is that?
}

i am registering the exception as follows :

void func foo(){

EXCEPTION_REGISTRATION reg, *preg = ®
reg.handler = (DWORD)myHandler;
DWORD prev;
_asm {
mov EAX,FS:[0];
mov prev,EAX;
}
reg.prev = (EXCEPTION_REGISTRATION*)prev;
_asm {
mov EAX,preg;
mov FS:[0],EAX;
}
}

This is actually in a DLL file.

'DLL' is off-topic in this NG. Try one of the windows NGs.
After the execution of this function, the code exits.

I don't blame it, I'd exit too!!
This code is running on a web server, if there are no
exceptions, it should not exit. Any idea why this is happening?
Regards, Deepak Srivastav

Don't know, too much missing to tell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top