From 5625c6079ef84ab5f2c61991023d91db381a05a3 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 1 Mar 2008 11:57:00 +0100 Subject: [PATCH] Get rid of the global thread.h header. --- dlls/kernel32/file.c | 1 - dlls/kernel32/instr.c | 10 ++-- dlls/kernel32/module.c | 1 - dlls/kernel32/task.c | 1 - dlls/kernel32/thread.c | 1 - dlls/kernel32/wowthunk.c | 5 +- dlls/ntdll/directory.c | 1 - dlls/ntdll/env.c | 1 - dlls/ntdll/file.c | 1 - dlls/ntdll/path.c | 1 - dlls/ntdll/signal_i386.c | 15 +++-- dlls/ntdll/sync.c | 2 +- dlls/ntdll/thread.c | 2 +- dlls/winedos/dosvm.c | 10 ++-- dlls/winedos/int31.c | 30 +++++----- dlls/winedos/interrupts.c | 5 +- include/thread.h | 115 -------------------------------------- include/winternl.h | 37 ++++++++++-- tools/make_makefiles | 1 - tools/winebuild/relay.c | 10 +++- 20 files changed, 76 insertions(+), 174 deletions(-) delete mode 100644 include/thread.h diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index a5da6c66efa..8c6f40492e0 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -45,7 +45,6 @@ #include "wine/exception.h" #include "wine/unicode.h" #include "wine/debug.h" -#include "thread.h" WINE_DEFAULT_DEBUG_CHANNEL(file); diff --git a/dlls/kernel32/instr.c b/dlls/kernel32/instr.c index 87e486d3616..3a9f335b3ed 100644 --- a/dlls/kernel32/instr.c +++ b/dlls/kernel32/instr.c @@ -27,9 +27,9 @@ #include "windef.h" #include "winbase.h" +#include "winternl.h" #include "wine/winuser16.h" #include "excpt.h" -#include "thread.h" #include "wine/debug.h" #include "kernel_private.h" #include "kernel16_private.h" @@ -851,16 +851,16 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context ) return ExceptionContinueExecution; case 0xfa: /* cli */ - NtCurrentTeb()->dpmi_vif = 0; + get_vm86_teb_info()->dpmi_vif = 0; context->Eip += prefixlen + 1; return ExceptionContinueExecution; case 0xfb: /* sti */ - NtCurrentTeb()->dpmi_vif = 1; + get_vm86_teb_info()->dpmi_vif = 1; context->Eip += prefixlen + 1; - if (NtCurrentTeb()->vm86_pending) + if (get_vm86_teb_info()->vm86_pending) { - NtCurrentTeb()->vm86_pending = 0; + get_vm86_teb_info()->vm86_pending = 0; rec->ExceptionCode = EXCEPTION_VM86_STI; break; /* Handle the pending event. */ } diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index 47ca1ea745b..e31f43d5a68 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -36,7 +36,6 @@ #include "windef.h" #include "winbase.h" #include "winternl.h" -#include "thread.h" #include "kernel_private.h" #include "wine/exception.h" diff --git a/dlls/kernel32/task.c b/dlls/kernel32/task.c index a853b1545d8..03913d7c5e8 100644 --- a/dlls/kernel32/task.c +++ b/dlls/kernel32/task.c @@ -37,7 +37,6 @@ #include "winuser.h" #include "wine/winbase16.h" -#include "thread.h" #include "winternl.h" #include "toolhelp.h" #include "kernel_private.h" diff --git a/dlls/kernel32/thread.c b/dlls/kernel32/thread.c index bbcccd4dd24..973279302e7 100644 --- a/dlls/kernel32/thread.c +++ b/dlls/kernel32/thread.c @@ -34,7 +34,6 @@ #include "windef.h" #include "winbase.h" #include "winerror.h" -#include "thread.h" #include "wine/winbase16.h" #include "wine/exception.h" #include "wine/library.h" diff --git a/dlls/kernel32/wowthunk.c b/dlls/kernel32/wowthunk.c index 2ccfddff39c..791f7cf96a0 100644 --- a/dlls/kernel32/wowthunk.c +++ b/dlls/kernel32/wowthunk.c @@ -31,7 +31,6 @@ #include "winerror.h" #include "wownt32.h" #include "excpt.h" -#include "thread.h" #include "winternl.h" #include "kernel_private.h" #include "kernel16_private.h" @@ -265,7 +264,7 @@ static DWORD call16_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RE * emulated because the instruction emulation requires * original CS:IP and the emulation may change TEB.dpmi_vif. */ - if(NtCurrentTeb()->dpmi_vif) + if(get_vm86_teb_info()->dpmi_vif) insert_event_check( context ); if (ret != ExceptionContinueSearch) return ret; @@ -625,7 +624,7 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, * Note that wine_call_to_16_regs overwrites context stack * pointer so we may modify it here without a problem. */ - if (NtCurrentTeb()->dpmi_vif) + if (get_vm86_teb_info()->dpmi_vif) { context->SegSs = wine_get_ds(); context->Esp = (DWORD)stack; diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 0be99421489..44cf615e3dd 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -64,7 +64,6 @@ #define WIN32_NO_STATUS #include "windef.h" #include "winnt.h" -#include "thread.h" #include "winternl.h" #include "ntdll_misc.h" #include "wine/unicode.h" diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index cc2a1f59d00..6110a743644 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -29,7 +29,6 @@ #include "winternl.h" #include "wine/unicode.h" #include "wine/debug.h" -#include "thread.h" #include "ntdll_misc.h" WINE_DEFAULT_DEBUG_CHANNEL(environ); diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 843f3f012ca..c7b944b6a9b 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -73,7 +73,6 @@ #define WIN32_NO_STATUS #include "wine/unicode.h" #include "wine/debug.h" -#include "thread.h" #include "wine/server.h" #include "ntdll_misc.h" diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 73a77a85c4a..8730af37f23 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -39,7 +39,6 @@ #include "wine/unicode.h" #include "wine/debug.h" #include "wine/library.h" -#include "thread.h" #include "ntdll_misc.h" WINE_DEFAULT_DEBUG_CHANNEL(file); diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index a6ca6fd1104..2cb59f53cc3 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -56,7 +56,6 @@ #endif #include "windef.h" -#include "thread.h" #include "wine/library.h" #include "ntdll_misc.h" #include "wine/exception.h" @@ -532,7 +531,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec ) * we are returning from exception handler, pending events * will be rechecked after each raised exception. */ - while (check_pending && NtCurrentTeb()->vm86_pending) + while (check_pending && get_vm86_teb_info()->vm86_pending) { check_pending = FALSE; ntdll_get_thread_data()->vm86_ptr = NULL; @@ -554,7 +553,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec ) rec->ExceptionAddress = (LPVOID)vcontext.Eip; vcontext.EFlags &= ~VIP_MASK; - NtCurrentTeb()->vm86_pending = 0; + get_vm86_teb_info()->vm86_pending = 0; __regs_RtlRaiseException( rec, &vcontext ); restore_vm86_context( &vcontext, vm86 ); @@ -569,7 +568,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec ) * that the following operation compiles into atomic * instruction. */ - vm86->regs.eflags |= NtCurrentTeb()->vm86_pending; + vm86->regs.eflags |= get_vm86_teb_info()->vm86_pending; } #endif /* __HAVE_VM86 */ @@ -1212,7 +1211,7 @@ static void WINAPI raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) static void WINAPI raise_vm86_sti_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) { /* merge_vm86_pending_flags merges the vm86_pending flag in safely */ - NtCurrentTeb()->vm86_pending |= VIP_MASK; + get_vm86_teb_info()->vm86_pending |= VIP_MASK; if (ntdll_get_thread_data()->vm86_ptr) { @@ -1224,12 +1223,12 @@ static void WINAPI raise_vm86_sti_exception( EXCEPTION_RECORD *rec, CONTEXT *con } merge_vm86_pending_flags( rec ); } - else if (NtCurrentTeb()->dpmi_vif && + else if (get_vm86_teb_info()->dpmi_vif && !wine_ldt_is_system(context->SegCs) && !wine_ldt_is_system(context->SegSs)) { /* Executing DPMI code and virtual interrupts are enabled. */ - NtCurrentTeb()->vm86_pending = 0; + get_vm86_teb_info()->vm86_pending = 0; __regs_RtlRaiseException( rec, context ); } done: @@ -1614,7 +1613,7 @@ void __wine_enter_vm86( CONTEXT *context ) case VM86_STI: /* sti/popf/iret instruction enabled virtual interrupts */ context->EFlags |= VIF_MASK; context->EFlags &= ~VIP_MASK; - NtCurrentTeb()->vm86_pending = 0; + get_vm86_teb_info()->vm86_pending = 0; rec.ExceptionCode = EXCEPTION_VM86_STI; break; case VM86_PICRETURN: /* return due to pending PIC request */ diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index fd7630f5eb0..fb653daf2a5 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -53,7 +53,7 @@ #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" -#include "thread.h" +#include "winternl.h" #include "wine/server.h" #include "wine/debug.h" #include "ntdll_misc.h" diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index ff00f2eb455..1115ca7cbb2 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -22,6 +22,7 @@ #include "wine/port.h" #include +#include #include #ifdef HAVE_SYS_MMAN_H #include @@ -33,7 +34,6 @@ #define NONAMELESSUNION #include "ntstatus.h" #define WIN32_NO_STATUS -#include "thread.h" #include "winternl.h" #include "wine/library.h" #include "wine/server.h" diff --git a/dlls/winedos/dosvm.c b/dlls/winedos/dosvm.c index 51e8e568e7e..27dc3b7d147 100644 --- a/dlls/winedos/dosvm.c +++ b/dlls/winedos/dosvm.c @@ -42,13 +42,13 @@ #include "wine/exception.h" #include "windef.h" #include "winbase.h" +#include "winternl.h" #include "wingdi.h" #include "winuser.h" #include "wownt32.h" #include "winnt.h" #include "wincon.h" -#include "thread.h" #include "dosexe.h" #include "dosvm.h" #include "wine/debug.h" @@ -222,7 +222,7 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context ) * We disable it here because this prevents some * unnecessary calls to this function. */ - NtCurrentTeb()->vm86_pending = 0; + get_vm86_teb_info()->vm86_pending = 0; } #ifdef MZ_SUPPORTED @@ -234,7 +234,7 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context ) * pending events, make sure that pending flag is turned on. */ TRACE( "Another event is pending, setting VIP flag.\n" ); - NtCurrentTeb()->vm86_pending |= VIP_MASK; + get_vm86_teb_info()->vm86_pending |= VIP_MASK; } #else @@ -623,7 +623,7 @@ void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val) if (DOSVM_HasPendingEvents()) { TRACE( "Another event pending, setting pending flag\n" ); - NtCurrentTeb()->vm86_pending |= VIP_MASK; + get_vm86_teb_info()->vm86_pending |= VIP_MASK; } } @@ -691,7 +691,7 @@ void WINAPI DOSVM_AcknowledgeIRQ( CONTEXT86 *context ) * to turn VIF flag on before they return. */ if (!ISV86(context)) - NtCurrentTeb()->dpmi_vif = 1; + get_vm86_teb_info()->dpmi_vif = 1; } diff --git a/dlls/winedos/int31.c b/dlls/winedos/int31.c index b1dfe4b3dba..69fe7264a40 100644 --- a/dlls/winedos/int31.c +++ b/dlls/winedos/int31.c @@ -25,6 +25,7 @@ #include "windef.h" #include "winbase.h" +#include "winternl.h" #include "wine/winbase16.h" #include "wownt32.h" #include "dosexe.h" @@ -32,7 +33,6 @@ #include "excpt.h" #include "wine/debug.h" #include "wine/exception.h" -#include "thread.h" WINE_DEFAULT_DEBUG_CHANNEL(int31); @@ -353,10 +353,10 @@ __ASM_GLOBAL_FUNC(DPMI_CallRMCB32, */ static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag ) { - DWORD old_vif = NtCurrentTeb()->dpmi_vif; + DWORD old_vif = get_vm86_teb_info()->dpmi_vif; /* Disable virtual interrupts. */ - NtCurrentTeb()->dpmi_vif = 0; + get_vm86_teb_info()->dpmi_vif = 0; if (wine_ldt_is_system( rmcb->proc_sel )) { /* Wine-internal RMCB, call directly */ @@ -404,7 +404,7 @@ static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag ) } __EXCEPT(dpmi_exception_handler) { } __ENDTRY /* Restore virtual interrupt flag. */ - NtCurrentTeb()->dpmi_vif = old_vif; + get_vm86_teb_info()->dpmi_vif = old_vif; } @@ -734,7 +734,7 @@ void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context ) rm_ctx.SegGs = 0; /* Copy interrupt state. */ - if (NtCurrentTeb()->dpmi_vif) + if (get_vm86_teb_info()->dpmi_vif) rm_ctx.EFlags = V86_FLAG | VIF_MASK; else rm_ctx.EFlags = V86_FLAG; @@ -764,9 +764,9 @@ void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context ) /* Copy interrupt state. */ if (rm_ctx.EFlags & VIF_MASK) - NtCurrentTeb()->dpmi_vif = 1; + get_vm86_teb_info()->dpmi_vif = 1; else - NtCurrentTeb()->dpmi_vif = 0; + get_vm86_teb_info()->dpmi_vif = 0; /* Return to new address and hope that we didn't mess up */ TRACE("re-entering protected mode at %04x:%08x\n", @@ -1348,22 +1348,22 @@ void WINAPI DOSVM_Int31Handler( CONTEXT86 *context ) case 0x0900: /* Get and Disable Virtual Interrupt State */ TRACE( "Get and Disable Virtual Interrupt State: %d\n", - NtCurrentTeb()->dpmi_vif ); - SET_AL( context, NtCurrentTeb()->dpmi_vif ? 1 : 0 ); - NtCurrentTeb()->dpmi_vif = 0; + get_vm86_teb_info()->dpmi_vif ); + SET_AL( context, get_vm86_teb_info()->dpmi_vif ? 1 : 0 ); + get_vm86_teb_info()->dpmi_vif = 0; break; case 0x0901: /* Get and Enable Virtual Interrupt State */ TRACE( "Get and Enable Virtual Interrupt State: %d\n", - NtCurrentTeb()->dpmi_vif ); - SET_AL( context, NtCurrentTeb()->dpmi_vif ? 1 : 0 ); - NtCurrentTeb()->dpmi_vif = 1; + get_vm86_teb_info()->dpmi_vif ); + SET_AL( context, get_vm86_teb_info()->dpmi_vif ? 1 : 0 ); + get_vm86_teb_info()->dpmi_vif = 1; break; case 0x0902: /* Get Virtual Interrupt State */ TRACE( "Get Virtual Interrupt State: %d\n", - NtCurrentTeb()->dpmi_vif ); - SET_AL( context, NtCurrentTeb()->dpmi_vif ? 1 : 0 ); + get_vm86_teb_info()->dpmi_vif ); + SET_AL( context, get_vm86_teb_info()->dpmi_vif ? 1 : 0 ); break; case 0x0e00: /* Get Coprocessor Status (1.0) */ diff --git a/dlls/winedos/interrupts.c b/dlls/winedos/interrupts.c index a7c791f6106..580bee9553d 100644 --- a/dlls/winedos/interrupts.c +++ b/dlls/winedos/interrupts.c @@ -23,11 +23,10 @@ #include #include "dosexe.h" +#include "winternl.h" #include "wine/debug.h" #include "wine/winbase16.h" -#include "thread.h" - WINE_DEFAULT_DEBUG_CHANNEL(int); WINE_DECLARE_DEBUG_CHANNEL(relay); @@ -179,7 +178,7 @@ static void DOSVM_IntProcRelay( CONTEXT86 *context, LPVOID data ) static void DOSVM_PrepareIRQ( CONTEXT86 *context, BOOL isbuiltin ) { /* Disable virtual interrupts. */ - NtCurrentTeb()->dpmi_vif = 0; + get_vm86_teb_info()->dpmi_vif = 0; if (!isbuiltin) { diff --git a/include/thread.h b/include/thread.h deleted file mode 100644 index 34a284f7cd9..00000000000 --- a/include/thread.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Thread definitions - * - * Copyright 1996 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_THREAD_H -#define __WINE_THREAD_H - -#include -#include -#include -#include -#define WINE_NO_TEB -#include - -#ifndef WINE_TEB_DEFINED -#define WINE_TEB_DEFINED -typedef struct _TEB -{ - NT_TIB Tib; /* 12- 00 Thread information block */ - PVOID EnvironmentPointer; /* 12- 1c EnvironmentPointer (win95: tib flags + win16 mutex count) */ - CLIENT_ID ClientId; /* -2- 20 Process and thread id (win95: debug context) */ - PVOID ActiveRpcHandle; /* 028 */ - PVOID ThreadLocalStoragePointer; /* 02c Pointer to TLS array */ - PEB *Peb; /* 030 owning process PEB */ - DWORD LastErrorValue; /* 034 Last error code */ - ULONG CountOfOwnedCriticalSections; /* 038 */ - PVOID CsrClientThread; /* 03c */ - PVOID Win32ThreadInfo; /* 040 */ - ULONG Win32ClientInfo[0x1f]; /* 044 */ - PVOID WOW32Reserved; /* 0c0 */ - ULONG CurrentLocale; /* 0c4 */ - ULONG FpSoftwareStatusRegister; /* 0c8 */ - PVOID SystemReserved1[54]; /* 0cc */ - LONG ExceptionCode; /* 1a4 */ - ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8 */ - BYTE SpareBytes1[24]; /* 1bc */ - PVOID SystemReserved2[10]; /* 1d4 */ - - /* The following are Wine-specific fields (NT: GdiTebBatch) */ - DWORD dpmi_vif; /* 1fc protected mode virtual interrupt flag */ - ULONG_PTR vm86_pending; /* 200 data for vm86 mode */ - /* here is plenty space for wine specific fields (don't forget to change pad6!!) */ - DWORD pad6[310]; /* 204 */ - - ULONG gdiRgn; /* 6dc */ - ULONG gdiPen; /* 6e0 */ - ULONG gdiBrush; /* 6e4 */ - CLIENT_ID RealClientId; /* 6e8 */ - HANDLE GdiCachedProcessHandle; /* 6f0 */ - ULONG GdiClientPID; /* 6f4 */ - ULONG GdiClientTID; /* 6f8 */ - PVOID GdiThreadLocaleInfo; /* 6fc */ - PVOID UserReserved[5]; /* 700 */ - PVOID glDispachTable[280]; /* 714 */ - ULONG glReserved1[26]; /* b74 */ - PVOID glReserved2; /* bdc */ - PVOID glSectionInfo; /* be0 */ - PVOID glSection; /* be4 */ - PVOID glTable; /* be8 */ - PVOID glCurrentRC; /* bec */ - PVOID glContext; /* bf0 */ - ULONG LastStatusValue; /* bf4 */ - UNICODE_STRING StaticUnicodeString; /* bf8 */ - WCHAR StaticUnicodeBuffer[261]; /* c00 */ - PVOID DeallocationStack; /* e0c */ - PVOID TlsSlots[64]; /* e10 */ - LIST_ENTRY TlsLinks; /* f10 */ - PVOID Vdm; /* f18 */ - PVOID ReservedForNtRpc; /* f1c */ - PVOID DbgSsReserved[2]; /* f20 */ - ULONG HardErrorDisabled; /* f28 */ - PVOID Instrumentation[16]; /* f2c */ - PVOID WinSockData; /* f6c */ - ULONG GdiBatchCount; /* f70 */ - ULONG Spare2; /* f74 */ - ULONG Spare3; /* f78 */ - ULONG Spare4; /* f7c */ - PVOID ReservedForOle; /* f80 */ - ULONG WaitingOnLoaderLock; /* f84 */ - PVOID Reserved5[3]; /* f88 */ - PVOID *TlsExpansionSlots; /* f94 */ -} TEB; -#endif /* WINE_TEB_DEFINED */ - - -/* The thread information for 16-bit threads */ -/* NtCurrentTeb()->SubSystemTib points to this */ -typedef struct -{ - void *unknown; /* 00 unknown */ - UNICODE_STRING *exe_name; /* 04 exe module name */ - - /* the following fields do not exist under Windows */ - UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */ - CURDIR curdir; /* current directory */ - WCHAR curdir_buffer[MAX_PATH]; -} WIN16_SUBSYSTEM_TIB; - -#endif /* __WINE_THREAD_H */ diff --git a/include/winternl.h b/include/winternl.h index aa979343087..d8d64694400 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -295,9 +295,6 @@ typedef struct _PEB /*********************************************************************** * TEB data structure */ -#ifndef WINE_NO_TEB /* don't define TEB if included from thread.h */ -# ifndef WINE_TEB_DEFINED -# define WINE_TEB_DEFINED typedef struct _TEB { NT_TIB Tib; /* 000 */ @@ -319,7 +316,7 @@ typedef struct _TEB ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8 */ BYTE SpareBytes1[24]; /* 1bc used for ntdll private data in Wine */ PVOID SystemReserved2[10]; /* 1d4 used for ntdll private data in Wine */ - GDI_TEB_BATCH GdiTebBatch; /* 1fc */ + GDI_TEB_BATCH GdiTebBatch; /* 1fc used for vm86 private data in Wine */ ULONG gdiRgn; /* 6dc */ ULONG gdiPen; /* 6e0 */ ULONG gdiBrush; /* 6e4 */ @@ -366,8 +363,6 @@ typedef struct _TEB PVOID ActiveFrame; /* fb0 */ PVOID *FlsSlots; /* fb4 */ } TEB, *PTEB; -# endif /* WINE_TEB_DEFINED */ -#endif /* WINE_NO_TEB */ /*********************************************************************** * Enums @@ -2444,6 +2439,36 @@ static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le) return e; } + +#ifdef __WINESRC__ + +/* FIXME: private structure for vm86 mode, stored in teb->GdiTebBatch */ +typedef struct +{ + DWORD dpmi_vif; + DWORD vm86_pending; +} WINE_VM86_TEB_INFO; + +static inline WINE_VM86_TEB_INFO *get_vm86_teb_info(void) +{ + return (WINE_VM86_TEB_INFO *)&NtCurrentTeb()->GdiTebBatch; +} + +/* The thread information for 16-bit threads */ +/* NtCurrentTeb()->SubSystemTib points to this */ +typedef struct +{ + void *unknown; /* 00 unknown */ + UNICODE_STRING *exe_name; /* 04 exe module name */ + + /* the following fields do not exist under Windows */ + UNICODE_STRING exe_str; /* exe name string pointed to by exe_name */ + CURDIR curdir; /* current directory */ + WCHAR curdir_buffer[MAX_PATH]; +} WIN16_SUBSYSTEM_TIB; + +#endif /* __WINESRC__ */ + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ diff --git a/tools/make_makefiles b/tools/make_makefiles index 936222b1443..4de81a40840 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -103,7 +103,6 @@ my @ignore_srcs = ( ); my %private_headers = ( - "thread.h" => 1, "wine/irot.idl" => 1, "wine/list.h" => 1, "wine/mmsystem16.h" => 1, diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 227efa7ba2a..4ec0dbfb2f3 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -26,8 +26,10 @@ #include "wine/port.h" #include +#include -#include "thread.h" +#define __WINESRC__ /* FIXME: for WINE_VM86_TEB_INFO */ +#include "winternl.h" #include "wine/winbase16.h" #include "build.h" @@ -891,9 +893,11 @@ static void BuildPendingEventCheck(void) /* Check for pending events. */ - output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", STRUCTOFFSET(TEB,vm86_pending) ); + output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", + STRUCTOFFSET(TEB,GdiTebBatch) + STRUCTOFFSET(WINE_VM86_TEB_INFO,vm86_pending) ); output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") ); - output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", STRUCTOFFSET(TEB,dpmi_vif) ); + output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", + STRUCTOFFSET(TEB,GdiTebBatch) + STRUCTOFFSET(WINE_VM86_TEB_INFO,dpmi_vif) ); output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") ); /* Process pending events. */