STOWED_EXCEPTION_INFORMATION_V2 structure

Contains stowed exception info.

Syntax

typedef struct _STOWED_EXCEPTION_INFORMATION_V2 {
  STOWED_EXCEPTION_INFORMATION_HEADER Header;
  HRESULT                             ResultCode;
  struct {
    DWORD ExceptionForm  :2;
    DWORD ThreadId  :30;
  };
  union {
    struct {
      PVOID ExceptionAddress;
      ULONG StackTraceWordSize;
      ULONG StackTraceWords;
      PVOID StackTrace;
    };
    struct {
      PWSTR ErrorText;
    };
  };
  ULONG                               NestedExceptionType;
  PVOID                               NestedException;
} STOWED_EXCEPTION_INFORMATION_V2, *PSTOWED_EXCEPTION_INFORMATION_V2;

Members

Header

Type: STOWED_EXCEPTION_INFORMATION_HEADER

The STOWED_EXCEPTION_INFORMATION_HEADER structure that contains info for this parent structure.

ResultCode

Type: HRESULT

The HRESULT code for the stowed exception.

ExceptionForm

Type: DWORD

A 2-bit value that identifies the form of the exception.

Value Meaning
STOWED_EXCEPTION_FORM_BINARY
0x01
This value indicates that the form of the exception is binary.
STOWED_EXCEPTION_FORM_TEXT
0x02
This value indicates that the form of the exception is text.

ThreadId

Type: DWORD

A 30-bit value that identifies the thread that raised the exception. The value is shifted to the right by 2 bits when it's stored. To convert it back to a valid thread ID, shift the value to the left by 2. For example:

DWORD ActualThreadId = (StowedException.ThreadId << 2);

(unnamed struct)

The members of this nested structure are valid only if the ExceptionForm member is set to STOWED_EXCEPTION_FORM_BINARY.

ExceptionAddress

Type: PVOID

A pointer that contains the exception address.

StackTraceWordSize

Type: ULONG

Size, in bytes, of each word in the stack trace that the StackTrace member points to. This value is set to 4 for 32-bit platforms and 8 for 64-bit platforms.

StackTraceWords

Type: ULONG

The number of words in the stack trace that the StackTrace member points to. The number of words is equal to the number of elements in the array.

StackTrace

Type: PVOID

A pointer to a memory block that contains the stack trace.

(unnamed struct)

The member of this nested structure is valid only if the ExceptionForm member is set to STOWED_EXCEPTION_FORM_TEXT.

ErrorText

Type: PWSTR

A pointer to a null-terminated string that contains the error text of the exception.

NestedExceptionType

Type: ULONG

A 32-bit value that specifies the type of object that the NestedException member points to. Define the value with this byte swap type-definition macro that assumes little-endian:

#define STOWED_EXCEPTION_NESTED_TYPE(t) ((((((ULONG)(t)) >> 24) & 0xFF) <<  0) | \
                                         (((((ULONG)(t)) >> 16) & 0xFF) <<  8) | \
                                         (((((ULONG)(t)) >>  8) & 0xFF) << 16) | \
                                         (((((ULONG)(t)) >>  0) & 0xFF) << 24))

Here are some common type definitions:

Value Meaning
STOWED_EXCEPTION_NESTED_TYPE_NONE
(0x00000000)
This value specifies that there is no nested exception object.
STOWED_EXCEPTION_NESTED_TYPE_WIN32
STOWED_EXCEPTION_NESTED_TYPE('W32E')
This value specifies that the NestedException member points to an EXCEPTION_RECORD object.
STOWED_EXCEPTION_NESTED_TYPE_STOWED
STOWED_EXCEPTION_NESTED_TYPE('STOW')
This value specifies that the NestedException member points to another stowed exception object. The other stowed exception object can be a STOWED_EXCEPTION_INFORMATION_V2 object or a different version with a valid Header member, that is, a Header member that contains a valid STOWED_EXCEPTION_INFORMATION_HEADER.
STOWED_EXCEPTION_NESTED_TYPE_CLR
STOWED_EXCEPTION_NESTED_TYPE('CLR1')
This value specifies that the NestedException member points to a 'CLR1' exception object.
STOWED_EXCEPTION_NESTED_TYPE_LEO
STOWED_EXCEPTION_NESTED_TYPE('LEO1')
This value specifies that the NestedException member points to a language exception object.

NestedException

Type: PVOID

A pointer to a nested exception type. The type of object is indicated by the NestedExceptionType member.

Remarks

STOWED_EXCEPTION_INFORMATION_V2 and STOWED_EXCEPTION_INFORMATION_HEADER currently aren't defined in a header that is publicly available so you need to define them in your source code before you use them.

The STOWED_EXCEPTION_INFORMATION_V1 structure is identical to this structure except it doesn't contain the NestedExceptionType and NestedException members.

Requirements

Requirement Value
Minimum supported client
Windows 8.1 [desktop apps only]
Minimum supported server
Windows Server 2012 R2 [desktop apps only]
Header
None

See also

EXCEPTION_RECORD

STOWED_EXCEPTION_INFORMATION_HEADER