Release 970112
[wine/multimedia.git] / include / winnt.h
blob55a96a89f0015c8c03c4db7b36a3e99c8f88bcbb
1 /*
2 * Win32 definitions for Windows NT
4 * Copyright 1996 Alexandre Julliard
5 */
7 #ifndef __WINE_WINNT_H
8 #define __WINE_WINNT_H
10 #include "wintypes.h"
12 /* Heap flags */
14 #define HEAP_NO_SERIALIZE 0x00000001
15 #define HEAP_GROWABLE 0x00000002
16 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
17 #define HEAP_ZERO_MEMORY 0x00000008
18 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
19 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
20 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
21 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
22 #define HEAP_CREATE_ALIGN_16 0x00010000
23 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
24 #define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
25 #define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */
27 /* The Win32 register context */
29 #define CONTEXT_i386 0x00010000
30 #define CONTEXT_i486 CONTEXT_i386
31 #define CONTEXT_CONTROL (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
32 #define CONTEXT_INTEGER (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
33 #define CONTEXT_SEGMENTS (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
34 #define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 0x0008L) /* 387 state */
35 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
36 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS)
38 #define SIZE_OF_80387_REGISTERS 80
40 typedef struct
42 DWORD ControlWord;
43 DWORD StatusWord;
44 DWORD TagWord;
45 DWORD ErrorOffset;
46 DWORD ErrorSelector;
47 DWORD DataOffset;
48 DWORD DataSelector;
49 BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
50 DWORD Cr0NpxState;
51 } FLOATING_SAVE_AREA;
53 typedef struct
55 DWORD ContextFlags;
57 /* These are selected by CONTEXT_DEBUG_REGISTERS */
58 DWORD Dr0;
59 DWORD Dr1;
60 DWORD Dr2;
61 DWORD Dr3;
62 DWORD Dr6;
63 DWORD Dr7;
65 /* These are selected by CONTEXT_FLOATING_POINT */
66 FLOATING_SAVE_AREA FloatSave;
68 /* These are selected by CONTEXT_SEGMENTS */
69 DWORD SegGs;
70 DWORD SegFs;
71 DWORD SegEs;
72 DWORD SegDs;
74 /* These are selected by CONTEXT_INTEGER */
75 DWORD Edi;
76 DWORD Esi;
77 DWORD Ebx;
78 DWORD Edx;
79 DWORD Ecx;
80 DWORD Eax;
82 /* These are selected by CONTEXT_CONTROL */
83 DWORD Ebp;
84 DWORD Eip;
85 DWORD SegCs;
86 DWORD EFlags;
87 DWORD Esp;
88 DWORD SegSs;
89 } CONTEXT, *PCONTEXT;
92 #ifdef __WINE__
94 /* Macros for easier access to context registers */
96 #define EAX_reg(context) ((context)->Eax)
97 #define EBX_reg(context) ((context)->Ebx)
98 #define ECX_reg(context) ((context)->Ecx)
99 #define EDX_reg(context) ((context)->Edx)
100 #define ESI_reg(context) ((context)->Esi)
101 #define EDI_reg(context) ((context)->Edi)
102 #define EBP_reg(context) ((context)->Ebp)
104 #define CS_reg(context) ((context)->SegCs)
105 #define DS_reg(context) ((context)->SegDs)
106 #define ES_reg(context) ((context)->SegEs)
107 #define FS_reg(context) ((context)->SegFs)
108 #define GS_reg(context) ((context)->SegGs)
109 #define SS_reg(context) ((context)->SegSs)
111 #define EFL_reg(context) ((context)->EFlags)
112 #define EIP_reg(context) ((context)->Eip)
113 #define ESP_reg(context) ((context)->Esp)
115 #define AX_reg(context) (*(WORD*)&EAX_reg(context))
116 #define BX_reg(context) (*(WORD*)&EBX_reg(context))
117 #define CX_reg(context) (*(WORD*)&ECX_reg(context))
118 #define DX_reg(context) (*(WORD*)&EDX_reg(context))
119 #define SI_reg(context) (*(WORD*)&ESI_reg(context))
120 #define DI_reg(context) (*(WORD*)&EDI_reg(context))
121 #define BP_reg(context) (*(WORD*)&EBP_reg(context))
123 #define AL_reg(context) (*(BYTE*)&EAX_reg(context))
124 #define AH_reg(context) (*((BYTE*)&EAX_reg(context)+1))
125 #define BL_reg(context) (*(BYTE*)&EBX_reg(context))
126 #define BH_reg(context) (*((BYTE*)&EBX_reg(context)+1))
127 #define CL_reg(context) (*(BYTE*)&ECX_reg(context))
128 #define CH_reg(context) (*((BYTE*)&ECX_reg(context)+1))
129 #define DL_reg(context) (*(BYTE*)&EDX_reg(context))
130 #define DH_reg(context) (*((BYTE*)&EDX_reg(context)+1))
132 #define IP_reg(context) (*(WORD*)&EIP_reg(context))
133 #define SP_reg(context) (*(WORD*)&ESP_reg(context))
135 #define FL_reg(context) (*(WORD*)&EFL_reg(context))
137 #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
138 #define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
140 #endif /* __WINE__ */
142 /* Language IDs */
144 #define LANG_NEUTRAL 0x00
145 #define LANG_ARABIC 0x01
146 #define LANG_AFRIKAANS 0x36
147 #define LANG_ALBANIAN 0x1c
148 #define LANG_BASQUE 0x2d
149 #define LANG_BULGARIAN 0x02
150 #define LANG_BYELORUSSIAN 0x23
151 #define LANG_CATALAN 0x03
152 #define LANG_CHINESE 0x04
153 #define LANG_CROATIAN 0x1a
154 #define LANG_CZECH 0x05
155 #define LANG_DANISH 0x06
156 #define LANG_DUTCH 0x13
157 #define LANG_ENGLISH 0x09
158 #define LANG_ESTONIAN 0x25
159 #define LANG_FAEROESE 0x38
160 #define LANG_FARSI 0x29
161 #define LANG_FINNISH 0x0b
162 #define LANG_FRENCH 0x0c
163 #define LANG_GERMAN 0x07
164 #define LANG_GREEK 0x08
165 #define LANG_HEBREW 0x0D
166 #define LANG_HUNGARIAN 0x0e
167 #define LANG_ICELANDIC 0x0f
168 #define LANG_INDONESIAN 0x21
169 #define LANG_ITALIAN 0x10
170 #define LANG_JAPANESE 0x11
171 #define LANG_KOREAN 0x12
172 #define LANG_LATVIAN 0x26
173 #define LANG_LITHUANIAN 0x27
174 #define LANG_NORWEGIAN 0x14
175 #define LANG_POLISH 0x15
176 #define LANG_PORTUGUESE 0x16
177 #define LANG_ROMANIAN 0x18
178 #define LANG_RUSSIAN 0x19
179 #define LANG_SLOVAK 0x1b
180 #define LANG_SLOVENIAN 0x24
181 #define LANG_SORBIAN 0x2e
182 #define LANG_SPANISH 0x0a
183 #define LANG_SWEDISH 0x1d
184 #define LANG_THAI 0x1e
185 #define LANG_TURKISH 0x1f
186 #define LANG_UKRAINIAN 0x22
188 #endif /* __WINE_WINNT_H */