Commit 5625c607 authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of the global thread.h header.

parent 848383ac
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "thread.h"
WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DEFAULT_DEBUG_CHANNEL(file);
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "excpt.h" #include "excpt.h"
#include "thread.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "kernel_private.h" #include "kernel_private.h"
#include "kernel16_private.h" #include "kernel16_private.h"
...@@ -851,16 +851,16 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context ) ...@@ -851,16 +851,16 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
return ExceptionContinueExecution; return ExceptionContinueExecution;
case 0xfa: /* cli */ case 0xfa: /* cli */
NtCurrentTeb()->dpmi_vif = 0; get_vm86_teb_info()->dpmi_vif = 0;
context->Eip += prefixlen + 1; context->Eip += prefixlen + 1;
return ExceptionContinueExecution; return ExceptionContinueExecution;
case 0xfb: /* sti */ case 0xfb: /* sti */
NtCurrentTeb()->dpmi_vif = 1; get_vm86_teb_info()->dpmi_vif = 1;
context->Eip += prefixlen + 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; rec->ExceptionCode = EXCEPTION_VM86_STI;
break; /* Handle the pending event. */ break; /* Handle the pending event. */
} }
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h" #include "winternl.h"
#include "thread.h"
#include "kernel_private.h" #include "kernel_private.h"
#include "wine/exception.h" #include "wine/exception.h"
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "winuser.h" #include "winuser.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "thread.h"
#include "winternl.h" #include "winternl.h"
#include "toolhelp.h" #include "toolhelp.h"
#include "kernel_private.h" #include "kernel_private.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "thread.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/library.h" #include "wine/library.h"
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "winerror.h" #include "winerror.h"
#include "wownt32.h" #include "wownt32.h"
#include "excpt.h" #include "excpt.h"
#include "thread.h"
#include "winternl.h" #include "winternl.h"
#include "kernel_private.h" #include "kernel_private.h"
#include "kernel16_private.h" #include "kernel16_private.h"
...@@ -265,7 +264,7 @@ static DWORD call16_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RE ...@@ -265,7 +264,7 @@ static DWORD call16_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RE
* emulated because the instruction emulation requires * emulated because the instruction emulation requires
* original CS:IP and the emulation may change TEB.dpmi_vif. * 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 ); insert_event_check( context );
if (ret != ExceptionContinueSearch) return ret; if (ret != ExceptionContinueSearch) return ret;
...@@ -625,7 +624,7 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, ...@@ -625,7 +624,7 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
* Note that wine_call_to_16_regs overwrites context stack * Note that wine_call_to_16_regs overwrites context stack
* pointer so we may modify it here without a problem. * 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->SegSs = wine_get_ds();
context->Esp = (DWORD)stack; context->Esp = (DWORD)stack;
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "windef.h" #include "windef.h"
#include "winnt.h" #include "winnt.h"
#include "thread.h"
#include "winternl.h" #include "winternl.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
#include "wine/unicode.h" #include "wine/unicode.h"
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "winternl.h" #include "winternl.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "thread.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
WINE_DEFAULT_DEBUG_CHANNEL(environ); WINE_DEFAULT_DEBUG_CHANNEL(environ);
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "thread.h"
#include "wine/server.h" #include "wine/server.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/library.h" #include "wine/library.h"
#include "thread.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DEFAULT_DEBUG_CHANNEL(file);
......
...@@ -56,7 +56,6 @@ ...@@ -56,7 +56,6 @@
#endif #endif
#include "windef.h" #include "windef.h"
#include "thread.h"
#include "wine/library.h" #include "wine/library.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
#include "wine/exception.h" #include "wine/exception.h"
...@@ -532,7 +531,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec ) ...@@ -532,7 +531,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec )
* we are returning from exception handler, pending events * we are returning from exception handler, pending events
* will be rechecked after each raised exception. * 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; check_pending = FALSE;
ntdll_get_thread_data()->vm86_ptr = NULL; ntdll_get_thread_data()->vm86_ptr = NULL;
...@@ -554,7 +553,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec ) ...@@ -554,7 +553,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec )
rec->ExceptionAddress = (LPVOID)vcontext.Eip; rec->ExceptionAddress = (LPVOID)vcontext.Eip;
vcontext.EFlags &= ~VIP_MASK; vcontext.EFlags &= ~VIP_MASK;
NtCurrentTeb()->vm86_pending = 0; get_vm86_teb_info()->vm86_pending = 0;
__regs_RtlRaiseException( rec, &vcontext ); __regs_RtlRaiseException( rec, &vcontext );
restore_vm86_context( &vcontext, vm86 ); restore_vm86_context( &vcontext, vm86 );
...@@ -569,7 +568,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec ) ...@@ -569,7 +568,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec )
* that the following operation compiles into atomic * that the following operation compiles into atomic
* instruction. * instruction.
*/ */
vm86->regs.eflags |= NtCurrentTeb()->vm86_pending; vm86->regs.eflags |= get_vm86_teb_info()->vm86_pending;
} }
#endif /* __HAVE_VM86 */ #endif /* __HAVE_VM86 */
...@@ -1212,7 +1211,7 @@ static void WINAPI raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context ) ...@@ -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 ) static void WINAPI raise_vm86_sti_exception( EXCEPTION_RECORD *rec, CONTEXT *context )
{ {
/* merge_vm86_pending_flags merges the vm86_pending flag in safely */ /* 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) if (ntdll_get_thread_data()->vm86_ptr)
{ {
...@@ -1224,12 +1223,12 @@ static void WINAPI raise_vm86_sti_exception( EXCEPTION_RECORD *rec, CONTEXT *con ...@@ -1224,12 +1223,12 @@ static void WINAPI raise_vm86_sti_exception( EXCEPTION_RECORD *rec, CONTEXT *con
} }
merge_vm86_pending_flags( rec ); 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->SegCs) &&
!wine_ldt_is_system(context->SegSs)) !wine_ldt_is_system(context->SegSs))
{ {
/* Executing DPMI code and virtual interrupts are enabled. */ /* Executing DPMI code and virtual interrupts are enabled. */
NtCurrentTeb()->vm86_pending = 0; get_vm86_teb_info()->vm86_pending = 0;
__regs_RtlRaiseException( rec, context ); __regs_RtlRaiseException( rec, context );
} }
done: done:
...@@ -1614,7 +1613,7 @@ void __wine_enter_vm86( CONTEXT *context ) ...@@ -1614,7 +1613,7 @@ void __wine_enter_vm86( CONTEXT *context )
case VM86_STI: /* sti/popf/iret instruction enabled virtual interrupts */ case VM86_STI: /* sti/popf/iret instruction enabled virtual interrupts */
context->EFlags |= VIF_MASK; context->EFlags |= VIF_MASK;
context->EFlags &= ~VIP_MASK; context->EFlags &= ~VIP_MASK;
NtCurrentTeb()->vm86_pending = 0; get_vm86_teb_info()->vm86_pending = 0;
rec.ExceptionCode = EXCEPTION_VM86_STI; rec.ExceptionCode = EXCEPTION_VM86_STI;
break; break;
case VM86_PICRETURN: /* return due to pending PIC request */ case VM86_PICRETURN: /* return due to pending PIC request */
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "windef.h" #include "windef.h"
#include "thread.h" #include "winternl.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "wine/port.h" #include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <stdarg.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
...@@ -33,7 +34,6 @@ ...@@ -33,7 +34,6 @@
#define NONAMELESSUNION #define NONAMELESSUNION
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "thread.h"
#include "winternl.h" #include "winternl.h"
#include "wine/library.h" #include "wine/library.h"
#include "wine/server.h" #include "wine/server.h"
......
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
#include "wine/exception.h" #include "wine/exception.h"
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "wownt32.h" #include "wownt32.h"
#include "winnt.h" #include "winnt.h"
#include "wincon.h" #include "wincon.h"
#include "thread.h"
#include "dosexe.h" #include "dosexe.h"
#include "dosvm.h" #include "dosvm.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -222,7 +222,7 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context ) ...@@ -222,7 +222,7 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context )
* We disable it here because this prevents some * We disable it here because this prevents some
* unnecessary calls to this function. * unnecessary calls to this function.
*/ */
NtCurrentTeb()->vm86_pending = 0; get_vm86_teb_info()->vm86_pending = 0;
} }
#ifdef MZ_SUPPORTED #ifdef MZ_SUPPORTED
...@@ -234,7 +234,7 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context ) ...@@ -234,7 +234,7 @@ void DOSVM_SendQueuedEvents( CONTEXT86 *context )
* pending events, make sure that pending flag is turned on. * pending events, make sure that pending flag is turned on.
*/ */
TRACE( "Another event is pending, setting VIP flag.\n" ); TRACE( "Another event is pending, setting VIP flag.\n" );
NtCurrentTeb()->vm86_pending |= VIP_MASK; get_vm86_teb_info()->vm86_pending |= VIP_MASK;
} }
#else #else
...@@ -623,7 +623,7 @@ void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val) ...@@ -623,7 +623,7 @@ void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val)
if (DOSVM_HasPendingEvents()) if (DOSVM_HasPendingEvents())
{ {
TRACE( "Another event pending, setting pending flag\n" ); 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 ) ...@@ -691,7 +691,7 @@ void WINAPI DOSVM_AcknowledgeIRQ( CONTEXT86 *context )
* to turn VIF flag on before they return. * to turn VIF flag on before they return.
*/ */
if (!ISV86(context)) if (!ISV86(context))
NtCurrentTeb()->dpmi_vif = 1; get_vm86_teb_info()->dpmi_vif = 1;
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wownt32.h" #include "wownt32.h"
#include "dosexe.h" #include "dosexe.h"
...@@ -32,7 +33,6 @@ ...@@ -32,7 +33,6 @@
#include "excpt.h" #include "excpt.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "thread.h"
WINE_DEFAULT_DEBUG_CHANNEL(int31); WINE_DEFAULT_DEBUG_CHANNEL(int31);
...@@ -353,10 +353,10 @@ __ASM_GLOBAL_FUNC(DPMI_CallRMCB32, ...@@ -353,10 +353,10 @@ __ASM_GLOBAL_FUNC(DPMI_CallRMCB32,
*/ */
static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag ) 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. */ /* Disable virtual interrupts. */
NtCurrentTeb()->dpmi_vif = 0; get_vm86_teb_info()->dpmi_vif = 0;
if (wine_ldt_is_system( rmcb->proc_sel )) { if (wine_ldt_is_system( rmcb->proc_sel )) {
/* Wine-internal RMCB, call directly */ /* Wine-internal RMCB, call directly */
...@@ -404,7 +404,7 @@ static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag ) ...@@ -404,7 +404,7 @@ static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag )
} __EXCEPT(dpmi_exception_handler) { } __ENDTRY } __EXCEPT(dpmi_exception_handler) { } __ENDTRY
/* Restore virtual interrupt flag. */ /* 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 ) ...@@ -734,7 +734,7 @@ void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context )
rm_ctx.SegGs = 0; rm_ctx.SegGs = 0;
/* Copy interrupt state. */ /* Copy interrupt state. */
if (NtCurrentTeb()->dpmi_vif) if (get_vm86_teb_info()->dpmi_vif)
rm_ctx.EFlags = V86_FLAG | VIF_MASK; rm_ctx.EFlags = V86_FLAG | VIF_MASK;
else else
rm_ctx.EFlags = V86_FLAG; rm_ctx.EFlags = V86_FLAG;
...@@ -764,9 +764,9 @@ void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context ) ...@@ -764,9 +764,9 @@ void WINAPI DOSVM_RawModeSwitchHandler( CONTEXT86 *context )
/* Copy interrupt state. */ /* Copy interrupt state. */
if (rm_ctx.EFlags & VIF_MASK) if (rm_ctx.EFlags & VIF_MASK)
NtCurrentTeb()->dpmi_vif = 1; get_vm86_teb_info()->dpmi_vif = 1;
else else
NtCurrentTeb()->dpmi_vif = 0; get_vm86_teb_info()->dpmi_vif = 0;
/* Return to new address and hope that we didn't mess up */ /* Return to new address and hope that we didn't mess up */
TRACE("re-entering protected mode at %04x:%08x\n", TRACE("re-entering protected mode at %04x:%08x\n",
...@@ -1348,22 +1348,22 @@ void WINAPI DOSVM_Int31Handler( CONTEXT86 *context ) ...@@ -1348,22 +1348,22 @@ void WINAPI DOSVM_Int31Handler( CONTEXT86 *context )
case 0x0900: /* Get and Disable Virtual Interrupt State */ case 0x0900: /* Get and Disable Virtual Interrupt State */
TRACE( "Get and Disable Virtual Interrupt State: %d\n", TRACE( "Get and Disable Virtual Interrupt State: %d\n",
NtCurrentTeb()->dpmi_vif ); get_vm86_teb_info()->dpmi_vif );
SET_AL( context, NtCurrentTeb()->dpmi_vif ? 1 : 0 ); SET_AL( context, get_vm86_teb_info()->dpmi_vif ? 1 : 0 );
NtCurrentTeb()->dpmi_vif = 0; get_vm86_teb_info()->dpmi_vif = 0;
break; break;
case 0x0901: /* Get and Enable Virtual Interrupt State */ case 0x0901: /* Get and Enable Virtual Interrupt State */
TRACE( "Get and Enable Virtual Interrupt State: %d\n", TRACE( "Get and Enable Virtual Interrupt State: %d\n",
NtCurrentTeb()->dpmi_vif ); get_vm86_teb_info()->dpmi_vif );
SET_AL( context, NtCurrentTeb()->dpmi_vif ? 1 : 0 ); SET_AL( context, get_vm86_teb_info()->dpmi_vif ? 1 : 0 );
NtCurrentTeb()->dpmi_vif = 1; get_vm86_teb_info()->dpmi_vif = 1;
break; break;
case 0x0902: /* Get Virtual Interrupt State */ case 0x0902: /* Get Virtual Interrupt State */
TRACE( "Get Virtual Interrupt State: %d\n", TRACE( "Get Virtual Interrupt State: %d\n",
NtCurrentTeb()->dpmi_vif ); get_vm86_teb_info()->dpmi_vif );
SET_AL( context, NtCurrentTeb()->dpmi_vif ? 1 : 0 ); SET_AL( context, get_vm86_teb_info()->dpmi_vif ? 1 : 0 );
break; break;
case 0x0e00: /* Get Coprocessor Status (1.0) */ case 0x0e00: /* Get Coprocessor Status (1.0) */
......
...@@ -23,11 +23,10 @@ ...@@ -23,11 +23,10 @@
#include <stdio.h> #include <stdio.h>
#include "dosexe.h" #include "dosexe.h"
#include "winternl.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "thread.h"
WINE_DEFAULT_DEBUG_CHANNEL(int); WINE_DEFAULT_DEBUG_CHANNEL(int);
WINE_DECLARE_DEBUG_CHANNEL(relay); WINE_DECLARE_DEBUG_CHANNEL(relay);
...@@ -179,7 +178,7 @@ static void DOSVM_IntProcRelay( CONTEXT86 *context, LPVOID data ) ...@@ -179,7 +178,7 @@ static void DOSVM_IntProcRelay( CONTEXT86 *context, LPVOID data )
static void DOSVM_PrepareIRQ( CONTEXT86 *context, BOOL isbuiltin ) static void DOSVM_PrepareIRQ( CONTEXT86 *context, BOOL isbuiltin )
{ {
/* Disable virtual interrupts. */ /* Disable virtual interrupts. */
NtCurrentTeb()->dpmi_vif = 0; get_vm86_teb_info()->dpmi_vif = 0;
if (!isbuiltin) if (!isbuiltin)
{ {
......
/*
* 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 <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#define WINE_NO_TEB
#include <winternl.h>
#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 */
...@@ -295,9 +295,6 @@ typedef struct _PEB ...@@ -295,9 +295,6 @@ typedef struct _PEB
/*********************************************************************** /***********************************************************************
* TEB data structure * 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 typedef struct _TEB
{ {
NT_TIB Tib; /* 000 */ NT_TIB Tib; /* 000 */
...@@ -319,7 +316,7 @@ typedef struct _TEB ...@@ -319,7 +316,7 @@ typedef struct _TEB
ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8 */ ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8 */
BYTE SpareBytes1[24]; /* 1bc used for ntdll private data in Wine */ BYTE SpareBytes1[24]; /* 1bc used for ntdll private data in Wine */
PVOID SystemReserved2[10]; /* 1d4 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 gdiRgn; /* 6dc */
ULONG gdiPen; /* 6e0 */ ULONG gdiPen; /* 6e0 */
ULONG gdiBrush; /* 6e4 */ ULONG gdiBrush; /* 6e4 */
...@@ -366,8 +363,6 @@ typedef struct _TEB ...@@ -366,8 +363,6 @@ typedef struct _TEB
PVOID ActiveFrame; /* fb0 */ PVOID ActiveFrame; /* fb0 */
PVOID *FlsSlots; /* fb4 */ PVOID *FlsSlots; /* fb4 */
} TEB, *PTEB; } TEB, *PTEB;
# endif /* WINE_TEB_DEFINED */
#endif /* WINE_NO_TEB */
/*********************************************************************** /***********************************************************************
* Enums * Enums
...@@ -2444,6 +2439,36 @@ static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le) ...@@ -2444,6 +2439,36 @@ static inline PLIST_ENTRY RemoveTailList(PLIST_ENTRY le)
return e; 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 #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif /* defined(__cplusplus) */ #endif /* defined(__cplusplus) */
......
...@@ -103,7 +103,6 @@ my @ignore_srcs = ( ...@@ -103,7 +103,6 @@ my @ignore_srcs = (
); );
my %private_headers = ( my %private_headers = (
"thread.h" => 1,
"wine/irot.idl" => 1, "wine/irot.idl" => 1,
"wine/list.h" => 1, "wine/list.h" => 1,
"wine/mmsystem16.h" => 1, "wine/mmsystem16.h" => 1,
......
...@@ -26,8 +26,10 @@ ...@@ -26,8 +26,10 @@
#include "wine/port.h" #include "wine/port.h"
#include <ctype.h> #include <ctype.h>
#include <stdarg.h>
#include "thread.h" #define __WINESRC__ /* FIXME: for WINE_VM86_TEB_INFO */
#include "winternl.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "build.h" #include "build.h"
...@@ -891,9 +893,11 @@ static void BuildPendingEventCheck(void) ...@@ -891,9 +893,11 @@ static void BuildPendingEventCheck(void)
/* Check for pending events. */ /* 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( "\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") ); output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") );
/* Process pending events. */ /* Process pending events. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment