what is the following type

M

Mosfet

Hi,

I am looking at some source code and in one file there is the following
definition :

typedef enum _EXCEPTION_DISPOSITION {
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind,
ExceptionExecuteHandler
} EXCEPTION_DISPOSITION;

typedef EXCEPTION_DISPOSITION EXCEPTION_ROUTINE (
struct _EXCEPTION_RECORD *ExceptionRecord,
void *EstablisherFrame,
struct _CONTEXT *ContextRecord,
struct _DISPATCHER_CONTEXT *DispatcherContext
);
typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;

EXCEPTION_ROUTINE __C_specific_handler;

I am puzzled by the EXCEPTION_ROUTINE definition, it looks like a
function pointer but without the *. Is it a function pointer ?
 
M

Mosfet

Mosfet a écrit :
Hi,

I am looking at some source code and in one file there is the following
definition :

typedef enum _EXCEPTION_DISPOSITION {
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind,
ExceptionExecuteHandler
} EXCEPTION_DISPOSITION;

typedef EXCEPTION_DISPOSITION EXCEPTION_ROUTINE (
struct _EXCEPTION_RECORD *ExceptionRecord,
void *EstablisherFrame,
struct _CONTEXT *ContextRecord,
struct _DISPATCHER_CONTEXT *DispatcherContext
);
typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;

EXCEPTION_ROUTINE __C_specific_handler;

I am puzzled by the EXCEPTION_ROUTINE definition, it looks like a
function pointer but without the *. Is it a function pointer ?

Hum actually I think it's a function type ... Someone to confirm ?
 
J

James Kanze

I am looking at some source code and in one file there is the following
definition :

It looks more like C than C++. The naming conventions are also
illegal, resulting in a lot of undefined behavior (both in C and
in C++). However...
typedef enum _EXCEPTION_DISPOSITION {
ExceptionContinueExecution,
ExceptionContinueSearch,
ExceptionNestedException,
ExceptionCollidedUnwind,
ExceptionExecuteHandler
} EXCEPTION_DISPOSITION;
typedef EXCEPTION_DISPOSITION EXCEPTION_ROUTINE (
struct _EXCEPTION_RECORD *ExceptionRecord,
void *EstablisherFrame,
struct _CONTEXT *ContextRecord,
struct _DISPATCHER_CONTEXT *DispatcherContext
);
typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE;
EXCEPTION_ROUTINE __C_specific_handler;
I am puzzled by the EXCEPTION_ROUTINE definition, it looks
like a function pointer but without the *. Is it a function
pointer ?

No. It's a function (type). You can use it to declare
functions, but not to define them. Thus, __C_specific_handler
is an (extern) function, or it would be if the name didn't
trigger undefined behavior.
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top