Merge sources from S-Core's RSA git (release)
[sdk/tools/sdb.git] / ansicon / wow64.h
1 /*
2   wow64.h - Definitions for Wow64.
3
4   Mingw64/TDM does not include these Wow64 definitions.
5 */
6
7 #ifndef WOW64_H
8 #define WOW64_H
9
10 #define WIN32_LEAN_AND_MEAN
11 #include <windows.h>
12
13 #define WOW64_CONTEXT_i386      0x00010000
14
15 #define WOW64_CONTEXT_CONTROL               (WOW64_CONTEXT_i386 | 0x00000001L)
16 #define WOW64_CONTEXT_INTEGER               (WOW64_CONTEXT_i386 | 0x00000002L)
17 #define WOW64_CONTEXT_SEGMENTS              (WOW64_CONTEXT_i386 | 0x00000004L)
18 #define WOW64_CONTEXT_FLOATING_POINT        (WOW64_CONTEXT_i386 | 0x00000008L)
19 #define WOW64_CONTEXT_DEBUG_REGISTERS       (WOW64_CONTEXT_i386 | 0x00000010L)
20 #define WOW64_CONTEXT_EXTENDED_REGISTERS    (WOW64_CONTEXT_i386 | 0x00000020L)
21
22 #define WOW64_CONTEXT_FULL      (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS)
23
24 #define WOW64_CONTEXT_ALL       (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS | \
25                                  WOW64_CONTEXT_FLOATING_POINT | WOW64_CONTEXT_DEBUG_REGISTERS | \
26                                  WOW64_CONTEXT_EXTENDED_REGISTERS)
27
28 #define WOW64_SIZE_OF_80387_REGISTERS      80
29
30 #define WOW64_MAXIMUM_SUPPORTED_EXTENSION     512
31
32 typedef struct _WOW64_FLOATING_SAVE_AREA {
33     DWORD   ControlWord;
34     DWORD   StatusWord;
35     DWORD   TagWord;
36     DWORD   ErrorOffset;
37     DWORD   ErrorSelector;
38     DWORD   DataOffset;
39     DWORD   DataSelector;
40     BYTE    RegisterArea[WOW64_SIZE_OF_80387_REGISTERS];
41     DWORD   Cr0NpxState;
42 } WOW64_FLOATING_SAVE_AREA;
43
44 typedef WOW64_FLOATING_SAVE_AREA *PWOW64_FLOATING_SAVE_AREA;
45
46 typedef struct _WOW64_CONTEXT {
47
48     DWORD ContextFlags;
49
50     DWORD   Dr0;
51     DWORD   Dr1;
52     DWORD   Dr2;
53     DWORD   Dr3;
54     DWORD   Dr6;
55     DWORD   Dr7;
56
57     WOW64_FLOATING_SAVE_AREA FloatSave;
58
59     DWORD   SegGs;
60     DWORD   SegFs;
61     DWORD   SegEs;
62     DWORD   SegDs;
63
64     DWORD   Edi;
65     DWORD   Esi;
66     DWORD   Ebx;
67     DWORD   Edx;
68     DWORD   Ecx;
69     DWORD   Eax;
70
71     DWORD   Ebp;
72     DWORD   Eip;
73     DWORD   SegCs;
74     DWORD   EFlags;
75     DWORD   Esp;
76     DWORD   SegSs;
77
78     BYTE    ExtendedRegisters[WOW64_MAXIMUM_SUPPORTED_EXTENSION];
79
80 } WOW64_CONTEXT;
81
82 typedef WOW64_CONTEXT *PWOW64_CONTEXT;
83
84
85 typedef BOOL (WINAPI *TWow64GetThreadContext)( HANDLE hThread, PWOW64_CONTEXT lpContext );
86 typedef BOOL (WINAPI *TWow64SetThreadContext)( HANDLE hThread, CONST WOW64_CONTEXT *lpContext );
87
88 #endif