Exception_Record in python2.5 problem

Posted by amir on Stack Overflow See other posts from Stack Overflow or by amir
Published on 2010-03-22T22:35:48Z Indexed on 2010/03/22 22:41 UTC
Read the original article Hit count: 335

Filed under:
|
|

I'm using Python2.5 & the following code produce 2 errors. Can any body help me?

class EXCEPTION_RECORD(Structure):
    _fields_ = [
        ("ExceptionCode", DWORD),
        ("ExceptionFlags", DWORD),
        ("ExceptionRecord", POINTER(EXCEPTION_RECORD)),
        ("ExceptionAddress", LPVOID),
        ("NumberParameters", DWORD),
        ("ExceptionInformation", ULONG_PTR * EXCEPTION_MAXIMUM_PARAMETERS)]

Python Error:

Traceback (most recent call last):
  File "E:\Python25\my_debugger_defines.py", line 70, in <module>
    class EXCEPTION_RECORD(Structure):
  File "E:\Python25\my_debugger_defines.py", line 74, in EXCEPTION_RECORD
    ("ExceptionRecord", POINTER(EXCEPTION_RECORD)),
NameError: name 'EXCEPTION_RECORD' is not defined

Microsoft Document:

The EXCEPTION_RECORD structure describes an exception. 

typedef struct _EXCEPTION_RECORD { // exr  
    DWORD ExceptionCode; 
    DWORD ExceptionFlags; 
    struct _EXCEPTION_RECORD *ExceptionRecord; 
    PVOID ExceptionAddress; 
    DWORD NumberParameters; 
    DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; 
} EXCEPTION_RECORD; 

Thanks in advance

© Stack Overflow or respective owner

Related posts about python

Related posts about Microsoft