blob: 31a73f9370cb1210c2dc783347a71b469b034080 [file] [log] [blame]
Alexandre Julliard9ea19e51997-01-01 17:29:55 +00001/*
2 * Thread definitions
3 *
4 * Copyright 1996 Alexandre Julliard
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00005 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000019 */
20
21#ifndef __WINE_THREAD_H
22#define __WINE_THREAD_H
23
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000024#include <stdarg.h>
25#include <windef.h>
26#include <winbase.h>
27#include <winreg.h>
Alexandre Julliard7df1b9e2003-08-28 19:57:35 +000028#define WINE_NO_TEB
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +000029#include <winternl.h>
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000030
Alexandre Julliard7df1b9e2003-08-28 19:57:35 +000031#ifndef WINE_TEB_DEFINED
32#define WINE_TEB_DEFINED
Alexandre Julliard9ea19e51997-01-01 17:29:55 +000033typedef struct _TEB
34{
Alexandre Julliardb91e9cb2003-08-28 03:44:41 +000035 NT_TIB Tib; /* 12- 00 Thread information block */
Alexandre Julliarda45931c2004-04-15 05:04:53 +000036 PVOID EnvironmentPointer; /* 12- 1c EnvironmentPointer (win95: tib flags + win16 mutex count) */
Alexandre Julliard02f28132003-08-27 23:14:29 +000037 CLIENT_ID ClientId; /* -2- 20 Process and thread id (win95: debug context) */
Alexandre Julliard86be9f22005-04-27 08:18:20 +000038 PVOID ActiveRpcHandle; /* 028 */
39 PVOID ThreadLocalStoragePointer; /* 02c Pointer to TLS array */
40 PEB *Peb; /* 030 owning process PEB */
41 DWORD LastErrorValue; /* 034 Last error code */
42 ULONG CountOfOwnedCriticalSections; /* 038 */
43 PVOID CsrClientThread; /* 03c */
44 PVOID Win32ThreadInfo; /* 040 */
45 ULONG Win32ClientInfo[0x1f]; /* 044 */
46 PVOID WOW32Reserved; /* 0c0 */
Alexandre Julliardab29aa22005-06-06 20:04:33 +000047 ULONG CurrentLocale; /* 0c4 */
48 ULONG FpSoftwareStatusRegister; /* 0c8 */
49 PVOID SystemReserved1[54]; /* 0cc */
50 PVOID Spare1; /* 1a4 */
51 LONG ExceptionCode; /* 1a8 */
52 BYTE SpareBytes1[40]; /* 1ac */
53 PVOID SystemReserved2[10]; /* 1d4 */
Juergen Schmied74341022000-01-15 22:22:27 +000054
Alexandre Julliardab29aa22005-06-06 20:04:33 +000055 /* The following are Wine-specific fields (NT: GdiTebBatch) */
56 DWORD gs_sel; /* 1fc %gs selector for this thread */
57 DWORD num_async_io; /* 200 number of pending async I/O in the server */
58 DWORD dpmi_vif; /* 204 protected mode virtual interrupt flag */
59 DWORD vm86_pending; /* 208 data for vm86 mode */
Juergen Schmied74341022000-01-15 22:22:27 +000060 /* here is plenty space for wine specific fields (don't forget to change pad6!!) */
Alexandre Julliardab29aa22005-06-06 20:04:33 +000061 DWORD pad6[308]; /* 20c */
Juergen Schmied74341022000-01-15 22:22:27 +000062
Alexandre Julliardab29aa22005-06-06 20:04:33 +000063 ULONG gdiRgn; /* 6dc */
64 ULONG gdiPen; /* 6e0 */
65 ULONG gdiBrush; /* 6e4 */
66 CLIENT_ID RealClientId; /* 6e8 */
67 HANDLE GdiCachedProcessHandle; /* 6f0 */
68 ULONG GdiClientPID; /* 6f4 */
69 ULONG GdiClientTID; /* 6f8 */
70 PVOID GdiThreadLocaleInfo; /* 6fc */
71 PVOID UserReserved[5]; /* 700 */
72 PVOID glDispachTable[280]; /* 714 */
73 ULONG glReserved1[26]; /* b74 */
74 PVOID glReserved2; /* bdc */
75 PVOID glSectionInfo; /* be0 */
76 PVOID glSection; /* be4 */
77 PVOID glTable; /* be8 */
78 PVOID glCurrentRC; /* bec */
79 PVOID glContext; /* bf0 */
80 ULONG LastStatusValue; /* bf4 */
81 UNICODE_STRING StaticUnicodeString; /* bf8 */
82 WCHAR StaticUnicodeBuffer[261]; /* c00 */
83 PVOID DeallocationStack; /* e0c */
84 PVOID TlsSlots[64]; /* e10 */
85 LIST_ENTRY TlsLinks; /* f10 */
Alexandre Julliard7e4af0f2005-05-14 11:09:21 +000086 PVOID Vdm; /* f18 */
87 PVOID ReservedForNtRpc; /* f1c */
88 PVOID DbgSsReserved[2]; /* f20 */
89 ULONG HardErrorDisabled; /* f28 */
90 PVOID Instrumentation[16]; /* f2c */
91 PVOID WinSockData; /* f6c */
92 ULONG GdiBatchCount; /* f70 */
93 ULONG Spare2; /* f74 */
94 ULONG Spare3; /* f78 */
95 ULONG Spare4; /* f7c */
96 PVOID ReservedForOle; /* f80 */
97 ULONG WaitingOnLoaderLock; /* f84 */
98 PVOID Reserved5[3]; /* f88 */
99 PVOID *TlsExpansionSlots; /* f94 */
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000100} TEB;
Alexandre Julliard7df1b9e2003-08-28 19:57:35 +0000101#endif /* WINE_TEB_DEFINED */
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000102
Alexandre Julliard186b4192004-04-16 00:10:03 +0000103
104/* The thread information for 16-bit threads */
105/* NtCurrentTeb()->SubSystemTib points to this */
106typedef struct
107{
108 void *unknown; /* 00 unknown */
109 UNICODE_STRING *exe_name; /* 04 exe module name */
110
111 /* the following fields do not exist under Windows */
112 UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */
Alexandre Julliarddfcfc982004-04-16 05:00:46 +0000113 CURDIR curdir; /* current directory */
Alexandre Julliard186b4192004-04-16 00:10:03 +0000114 WCHAR curdir_buffer[MAX_PATH];
115} WIN16_SUBSYSTEM_TIB;
116
Alexandre Julliard9ea19e51997-01-01 17:29:55 +0000117#endif /* __WINE_THREAD_H */