Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Thread definitions |
| 3 | * |
| 4 | * Copyright 1996 Alexandre Julliard |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 5 | * |
| 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 Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 19 | */ |
| 20 | |
| 21 | #ifndef __WINE_THREAD_H |
| 22 | #define __WINE_THREAD_H |
| 23 | |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 24 | #include <stdarg.h> |
| 25 | #include <windef.h> |
| 26 | #include <winbase.h> |
| 27 | #include <winreg.h> |
Alexandre Julliard | 7df1b9e | 2003-08-28 19:57:35 +0000 | [diff] [blame] | 28 | #define WINE_NO_TEB |
Dimitrie O. Paun | 53f9c21 | 2003-08-28 21:43:34 +0000 | [diff] [blame] | 29 | #include <winternl.h> |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 30 | |
Alexandre Julliard | 7df1b9e | 2003-08-28 19:57:35 +0000 | [diff] [blame] | 31 | #ifndef WINE_TEB_DEFINED |
| 32 | #define WINE_TEB_DEFINED |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 33 | typedef struct _TEB |
| 34 | { |
Alexandre Julliard | b91e9cb | 2003-08-28 03:44:41 +0000 | [diff] [blame] | 35 | NT_TIB Tib; /* 12- 00 Thread information block */ |
Alexandre Julliard | a45931c | 2004-04-15 05:04:53 +0000 | [diff] [blame] | 36 | PVOID EnvironmentPointer; /* 12- 1c EnvironmentPointer (win95: tib flags + win16 mutex count) */ |
Alexandre Julliard | 02f2813 | 2003-08-27 23:14:29 +0000 | [diff] [blame] | 37 | CLIENT_ID ClientId; /* -2- 20 Process and thread id (win95: debug context) */ |
Alexandre Julliard | 86be9f2 | 2005-04-27 08:18:20 +0000 | [diff] [blame] | 38 | 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 Julliard | ab29aa2 | 2005-06-06 20:04:33 +0000 | [diff] [blame] | 47 | 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 Schmied | 7434102 | 2000-01-15 22:22:27 +0000 | [diff] [blame] | 54 | |
Alexandre Julliard | ab29aa2 | 2005-06-06 20:04:33 +0000 | [diff] [blame] | 55 | /* 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 Schmied | 7434102 | 2000-01-15 22:22:27 +0000 | [diff] [blame] | 60 | /* here is plenty space for wine specific fields (don't forget to change pad6!!) */ |
Alexandre Julliard | ab29aa2 | 2005-06-06 20:04:33 +0000 | [diff] [blame] | 61 | DWORD pad6[308]; /* 20c */ |
Juergen Schmied | 7434102 | 2000-01-15 22:22:27 +0000 | [diff] [blame] | 62 | |
Alexandre Julliard | ab29aa2 | 2005-06-06 20:04:33 +0000 | [diff] [blame] | 63 | 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 Julliard | 7e4af0f | 2005-05-14 11:09:21 +0000 | [diff] [blame] | 86 | 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 Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 100 | } TEB; |
Alexandre Julliard | 7df1b9e | 2003-08-28 19:57:35 +0000 | [diff] [blame] | 101 | #endif /* WINE_TEB_DEFINED */ |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 102 | |
Alexandre Julliard | 186b419 | 2004-04-16 00:10:03 +0000 | [diff] [blame] | 103 | |
| 104 | /* The thread information for 16-bit threads */ |
| 105 | /* NtCurrentTeb()->SubSystemTib points to this */ |
| 106 | typedef 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 Julliard | dfcfc98 | 2004-04-16 05:00:46 +0000 | [diff] [blame] | 113 | CURDIR curdir; /* current directory */ |
Alexandre Julliard | 186b419 | 2004-04-16 00:10:03 +0000 | [diff] [blame] | 114 | WCHAR curdir_buffer[MAX_PATH]; |
| 115 | } WIN16_SUBSYSTEM_TIB; |
| 116 | |
Alexandre Julliard | 9ea19e5 | 1997-01-01 17:29:55 +0000 | [diff] [blame] | 117 | #endif /* __WINE_THREAD_H */ |