Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > what is the following type

Reply
Thread Tools

what is the following type

 
 
Mosfet
Guest
Posts: n/a
 
      12-01-2008
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 ?
 
Reply With Quote
 
 
 
 
Mosfet
Guest
Posts: n/a
 
      12-01-2008
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 ?
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      12-02-2008
On Dec 1, 9:55 pm, Mosfet <mos...@anonymous.org> wrote:

> 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.

--
James Kanze (GABI Software) email:
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
Does the following construct qualify as overloading on return type ? Nikhil.S.Ketkar@gmail.com C++ 0 08-15-2008 08:35 AM
Help me find a good typedef name for the following type Eric Lilja C++ 3 03-06-2005 02:58 PM
RE: The Web server reported the following error when attempting to create or open the Web project located at the following URL: <URL> =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:36 AM
What's wrong with the following code to capture the Browser type? Greener Javascript 8 10-08-2003 09:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57