Commit 7d5bc5c3 authored by Alexandre Julliard's avatar Alexandre Julliard

Removed some direct accesses to the 16-bit task structure.

parent ea6a10de
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "wine/exception.h" #include "wine/exception.h"
#include "debugger.h" #include "debugger.h"
#include "expr.h" #include "expr.h"
#include "task.h"
extern FILE * yyin; extern FILE * yyin;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <string.h> #include <string.h>
#include "winbase.h" #include "winbase.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "task.h"
#include "debugger.h" #include "debugger.h"
#include "expr.h" #include "expr.h"
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#include "wine/winsock16.h" #include "wine/winsock16.h"
#include "winnt.h" #include "winnt.h"
#include "heap.h" #include "heap.h"
#include "task.h"
#include "wine/port.h" #include "wine/port.h"
#include "debugtools.h" #include "debugtools.h"
......
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
#include "wine/winsock16.h" #include "wine/winsock16.h"
#include "winnt.h" #include "winnt.h"
#include "heap.h" #include "heap.h"
#include "task.h"
#include "wine/port.h" #include "wine/port.h"
#include "services.h" #include "services.h"
#include "server.h" #include "server.h"
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "file.h" #include "file.h"
#include "heap.h" #include "heap.h"
#include "msdos.h" #include "msdos.h"
#include "task.h"
#include "wincon.h" #include "wincon.h"
#include "debugtools.h" #include "debugtools.h"
...@@ -1746,50 +1745,7 @@ LONG WINAPI _hwrite( HFILE handle, LPCSTR buffer, LONG count ) ...@@ -1746,50 +1745,7 @@ LONG WINAPI _hwrite( HFILE handle, LPCSTR buffer, LONG count )
*/ */
UINT16 WINAPI SetHandleCount16( UINT16 count ) UINT16 WINAPI SetHandleCount16( UINT16 count )
{ {
HGLOBAL16 hPDB = GetCurrentPDB16(); return SetHandleCount( count );
PDB16 *pdb = (PDB16 *)GlobalLock16( hPDB );
BYTE *files = MapSL( pdb->fileHandlesPtr );
TRACE("(%d)\n", count );
if (count < 20) count = 20; /* No point in going below 20 */
else if (count > 254) count = 254;
if (count == 20)
{
if (pdb->nbFiles > 20)
{
memcpy( pdb->fileHandles, files, 20 );
GlobalFree16( pdb->hFileHandles );
pdb->fileHandlesPtr = (SEGPTR)MAKELONG( 0x18,
GlobalHandleToSel16( hPDB ) );
pdb->hFileHandles = 0;
pdb->nbFiles = 20;
}
}
else /* More than 20, need a new file handles table */
{
BYTE *newfiles;
HGLOBAL16 newhandle = GlobalAlloc16( GMEM_MOVEABLE, count );
if (!newhandle)
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
return pdb->nbFiles;
}
newfiles = (BYTE *)GlobalLock16( newhandle );
if (count > pdb->nbFiles)
{
memcpy( newfiles, files, pdb->nbFiles );
memset( newfiles + pdb->nbFiles, 0xff, count - pdb->nbFiles );
}
else memcpy( newfiles, files, count );
if (pdb->nbFiles > 20) GlobalFree16( pdb->hFileHandles );
pdb->fileHandlesPtr = K32WOWGlobalLock16( newhandle );
pdb->hFileHandles = newhandle;
pdb->nbFiles = count;
}
return pdb->nbFiles;
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "stackframe.h" #include "stackframe.h"
#include "selectors.h" #include "selectors.h"
#include "builtin16.h" #include "builtin16.h"
#include "task.h"
#include "syslevel.h" #include "syslevel.h"
#include "debugtools.h" #include "debugtools.h"
#include "callback.h" #include "callback.h"
......
...@@ -95,7 +95,6 @@ typedef struct tagMESSAGEQUEUE ...@@ -95,7 +95,6 @@ typedef struct tagMESSAGEQUEUE
DWORD magic; /* magic number should be QUEUE_MAGIC */ DWORD magic; /* magic number should be QUEUE_MAGIC */
DWORD lockCount; /* reference counter */ DWORD lockCount; /* reference counter */
WORD wWinVersion; /* Expected Windows version */
WORD msgCount; /* Number of waiting messages */ WORD msgCount; /* Number of waiting messages */
QMSG* firstMsg; /* First message in linked list */ QMSG* firstMsg; /* First message in linked list */
......
...@@ -153,10 +153,4 @@ extern void TASK_Reschedule(void); ...@@ -153,10 +153,4 @@ extern void TASK_Reschedule(void);
extern void TASK_InstallTHHook( THHOOK *pNewThook ); extern void TASK_InstallTHHook( THHOOK *pNewThook );
extern void TASK_CallTaskSignalProc( UINT16 uCode, HANDLE16 hTaskOrModule ); extern void TASK_CallTaskSignalProc( UINT16 uCode, HANDLE16 hTaskOrModule );
extern HQUEUE16 WINAPI SetThreadQueue16( DWORD thread, HQUEUE16 hQueue );
extern HQUEUE16 WINAPI GetThreadQueue16( DWORD thread );
extern VOID WINAPI SetFastQueue16( DWORD thread, HANDLE hQueue );
extern HANDLE WINAPI GetFastQueue16( void );
#endif /* __WINE_TASK_H */ #endif /* __WINE_TASK_H */
...@@ -168,6 +168,7 @@ SEGPTR WINAPI GetDOSEnvironment16(void); ...@@ -168,6 +168,7 @@ SEGPTR WINAPI GetDOSEnvironment16(void);
HMODULE16 WINAPI GetExePtr(HANDLE16); HMODULE16 WINAPI GetExePtr(HANDLE16);
WORD WINAPI GetExeVersion16(void); WORD WINAPI GetExeVersion16(void);
WORD WINAPI GetExpWinVer16(HMODULE16); WORD WINAPI GetExpWinVer16(HMODULE16);
HANDLE WINAPI GetFastQueue16(void);
DWORD WINAPI GetHeapSpaces16(HMODULE16); DWORD WINAPI GetHeapSpaces16(HMODULE16);
INT16 WINAPI GetInstanceData16(HINSTANCE16,WORD,INT16); INT16 WINAPI GetInstanceData16(HINSTANCE16,WORD,INT16);
BOOL16 WINAPI GetModuleName16(HINSTANCE16,LPSTR,INT16); BOOL16 WINAPI GetModuleName16(HINSTANCE16,LPSTR,INT16);
...@@ -178,6 +179,7 @@ DWORD WINAPI GetSelectorLimit16(WORD); ...@@ -178,6 +179,7 @@ DWORD WINAPI GetSelectorLimit16(WORD);
FARPROC16 WINAPI GetSetKernelDOSProc16(FARPROC16 DosProc); FARPROC16 WINAPI GetSetKernelDOSProc16(FARPROC16 DosProc);
HINSTANCE16 WINAPI GetTaskDS16(void); HINSTANCE16 WINAPI GetTaskDS16(void);
HQUEUE16 WINAPI GetTaskQueue16(HTASK16); HQUEUE16 WINAPI GetTaskQueue16(HTASK16);
HQUEUE16 WINAPI GetThreadQueue16(DWORD);
DWORD WINAPI GetWinFlags16(void); DWORD WINAPI GetWinFlags16(void);
DWORD WINAPI GlobalDOSAlloc16(DWORD); DWORD WINAPI GlobalDOSAlloc16(DWORD);
WORD WINAPI GlobalDOSFree16(WORD); WORD WINAPI GlobalDOSFree16(WORD);
...@@ -206,10 +208,12 @@ VOID WINAPI WIN32_OldYield16(void); ...@@ -206,10 +208,12 @@ VOID WINAPI WIN32_OldYield16(void);
VOID WINAPI PostEvent16(HTASK16); VOID WINAPI PostEvent16(HTASK16);
WORD WINAPI PrestoChangoSelector16(WORD,WORD); WORD WINAPI PrestoChangoSelector16(WORD,WORD);
WORD WINAPI SelectorAccessRights16(WORD,WORD,WORD); WORD WINAPI SelectorAccessRights16(WORD,WORD,WORD);
void WINAPI SetFastQueue16(DWORD,HANDLE);
VOID WINAPI SetPriority16(HTASK16,INT16); VOID WINAPI SetPriority16(HTASK16,INT16);
FARPROC16 WINAPI SetResourceHandler16(HINSTANCE16,LPCSTR,FARPROC16); FARPROC16 WINAPI SetResourceHandler16(HINSTANCE16,LPCSTR,FARPROC16);
WORD WINAPI SetSelectorLimit16(WORD,DWORD); WORD WINAPI SetSelectorLimit16(WORD,DWORD);
HQUEUE16 WINAPI SetTaskQueue16(HTASK16,HQUEUE16); HQUEUE16 WINAPI SetTaskQueue16(HTASK16,HQUEUE16);
HQUEUE16 WINAPI SetThreadQueue16(DWORD,HQUEUE16);
VOID WINAPI SwitchStackTo16(WORD,WORD,WORD); VOID WINAPI SwitchStackTo16(WORD,WORD,WORD);
BOOL16 WINAPI WaitEvent16(HTASK16); BOOL16 WINAPI WaitEvent16(HTASK16);
VOID WINAPI WriteOutProfiles16(void); VOID WINAPI WriteOutProfiles16(void);
......
...@@ -426,6 +426,7 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule ) ...@@ -426,6 +426,7 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule )
{ {
HFILE hf; HFILE hf;
HFILE16 hFile16; HFILE16 hFile16;
HGLOBAL16 sel;
/* Handle self-loading modules */ /* Handle self-loading modules */
SELFLOADHEADER *selfloadheader; SELFLOADHEADER *selfloadheader;
HMODULE16 mod = GetModuleHandle16("KERNEL"); HMODULE16 mod = GetModuleHandle16("KERNEL");
...@@ -439,7 +440,9 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule ) ...@@ -439,7 +440,9 @@ BOOL NE_LoadAllSegments( NE_MODULE *pModule )
selfloadheader->EntryAddrProc = GetProcAddress16(mod,"EntryAddrProc"); selfloadheader->EntryAddrProc = GetProcAddress16(mod,"EntryAddrProc");
selfloadheader->MyAlloc = GetProcAddress16(mod,"MyAlloc"); selfloadheader->MyAlloc = GetProcAddress16(mod,"MyAlloc");
selfloadheader->SetOwner = GetProcAddress16(mod,"FarSetOwner"); selfloadheader->SetOwner = GetProcAddress16(mod,"FarSetOwner");
pModule->self_loading_sel = SEL(GLOBAL_Alloc(GMEM_ZEROINIT, 0xFF00, pModule->self, WINE_LDT_FLAGS_DATA)); sel = GlobalAlloc16( GMEM_ZEROINIT, 0xFF00 );
pModule->self_loading_sel = SEL(sel);
FarSetOwner16( sel, pModule->self );
oldstack = NtCurrentTeb()->cur_stack; oldstack = NtCurrentTeb()->cur_stack;
NtCurrentTeb()->cur_stack = MAKESEGPTR(pModule->self_loading_sel, NtCurrentTeb()->cur_stack = MAKESEGPTR(pModule->self_loading_sel,
0xff00 - sizeof(STACK16FRAME) ); 0xff00 - sizeof(STACK16FRAME) );
...@@ -614,7 +617,7 @@ static VOID NE_GetDLLInitParams( NE_MODULE *pModule, ...@@ -614,7 +617,7 @@ static VOID NE_GetDLLInitParams( NE_MODULE *pModule,
* *
* Call the DLL initialization code * Call the DLL initialization code
*/ */
static BOOL NE_InitDLL( TDB* pTask, NE_MODULE *pModule ) static BOOL NE_InitDLL( NE_MODULE *pModule )
{ {
SEGTABLEENTRY *pSegTable; SEGTABLEENTRY *pSegTable;
WORD hInst, ds, heap; WORD hInst, ds, heap;
...@@ -668,7 +671,6 @@ static BOOL NE_InitDLL( TDB* pTask, NE_MODULE *pModule ) ...@@ -668,7 +671,6 @@ static BOOL NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
*/ */
void NE_InitializeDLLs( HMODULE16 hModule ) void NE_InitializeDLLs( HMODULE16 hModule )
{ {
TDB* pTask = (TDB*)GlobalLock16(GetCurrentTask());
NE_MODULE *pModule; NE_MODULE *pModule;
HMODULE16 *pDLL; HMODULE16 *pDLL;
...@@ -685,7 +687,7 @@ void NE_InitializeDLLs( HMODULE16 hModule ) ...@@ -685,7 +687,7 @@ void NE_InitializeDLLs( HMODULE16 hModule )
} }
GlobalFree16( to_init ); GlobalFree16( to_init );
} }
NE_InitDLL( pTask, pModule ); NE_InitDLL( pModule );
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "winerror.h" #include "winerror.h"
#include "module.h" #include "module.h"
#include "heap.h" #include "heap.h"
#include "task.h"
#include "stackframe.h" #include "stackframe.h"
#include "debugtools.h" #include "debugtools.h"
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "heap.h" #include "heap.h"
#include "callback.h" #include "callback.h"
#include "cursoricon.h" #include "cursoricon.h"
#include "task.h"
#include "module.h" #include "module.h"
#include "file.h" #include "file.h"
#include "debugtools.h" #include "debugtools.h"
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "task.h"
#include "heap.h" #include "heap.h"
#include "instance.h" #include "instance.h"
#include "local.h" #include "local.h"
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "miscemu.h" #include "miscemu.h"
/* #define DEBUG_INT */ /* #define DEBUG_INT */
#include "debugtools.h" #include "debugtools.h"
#include "task.h"
#include "callback.h" #include "callback.h"
/********************************************************************** /**********************************************************************
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "dosexe.h" #include "dosexe.h"
#include "miscemu.h" #include "miscemu.h"
#include "module.h" #include "module.h"
#include "task.h"
/* #define DEBUG_INT */ /* #define DEBUG_INT */
#include "debugtools.h" #include "debugtools.h"
#include "cdrom.h" #include "cdrom.h"
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "module.h" #include "module.h"
#include "file.h" #include "file.h"
#include "heap.h" #include "heap.h"
#include "task.h"
#include "thread.h" #include "thread.h"
#include "winerror.h" #include "winerror.h"
#include "server.h" #include "server.h"
...@@ -899,7 +898,6 @@ BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code ) ...@@ -899,7 +898,6 @@ BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code )
*/ */
DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset ) DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
{ {
TDB *pTask;
DWORD x, y; DWORD x, y;
TRACE_(win32)("(%ld, %d)\n", dwProcessID, offset ); TRACE_(win32)("(%ld, %d)\n", dwProcessID, offset );
...@@ -913,19 +911,16 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset ) ...@@ -913,19 +911,16 @@ DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
switch ( offset ) switch ( offset )
{ {
case GPD_APP_COMPAT_FLAGS: case GPD_APP_COMPAT_FLAGS:
pTask = (TDB *)GlobalLock16( GetCurrentTask() ); return GetAppCompatFlags16(0);
return pTask? pTask->compat_flags : 0;
case GPD_LOAD_DONE_EVENT: case GPD_LOAD_DONE_EVENT:
return current_process.load_done_evt; return current_process.load_done_evt;
case GPD_HINSTANCE16: case GPD_HINSTANCE16:
pTask = (TDB *)GlobalLock16( GetCurrentTask() ); return GetTaskDS16();
return pTask? pTask->hInstance : 0;
case GPD_WINDOWS_VERSION: case GPD_WINDOWS_VERSION:
pTask = (TDB *)GlobalLock16( GetCurrentTask() ); return GetExeVersion16();
return pTask? pTask->version : 0;
case GPD_THDB: case GPD_THDB:
return (DWORD)NtCurrentTeb() - 0x10 /* FIXME */; return (DWORD)NtCurrentTeb() - 0x10 /* FIXME */;
......
...@@ -9,10 +9,9 @@ ...@@ -9,10 +9,9 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "winnls.h" #include "winnls.h"
#include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "heap.h"
#include "task.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win32); DEFAULT_DEBUG_CHANNEL(win32);
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "heap.h" #include "heap.h"
#include "message.h" #include "message.h"
#include "task.h"
#include "queue.h" #include "queue.h"
#include "user.h" #include "user.h"
#include "clipboard.h" #include "clipboard.h"
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "cursoricon.h" #include "cursoricon.h"
#include "module.h" #include "module.h"
#include "debugtools.h" #include "debugtools.h"
#include "task.h"
#include "user.h" #include "user.h"
#include "input.h" #include "input.h"
#include "message.h" #include "message.h"
...@@ -623,7 +622,8 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16 ...@@ -623,7 +622,8 @@ static HGLOBAL16 CURSORICON_CreateFromResource( HINSTANCE16 hInstance, HGLOBAL16
CURSORICONINFO *info; CURSORICONINFO *info;
/* Make it owned by the module */ /* Make it owned by the module */
if (hInstance) FarSetOwner16( hObj, GetExePtr(hInstance) ); if (hInstance) hInstance = GetExePtr(hInstance);
FarSetOwner16( hObj, hInstance );
info = (CURSORICONINFO *)GlobalLock16( hObj ); info = (CURSORICONINFO *)GlobalLock16( hObj );
info->ptHotSpot.x = hotspot.x; info->ptHotSpot.x = hotspot.x;
...@@ -678,11 +678,8 @@ HICON WINAPI CreateIconFromResourceEx( LPBYTE bits, UINT cbSize, ...@@ -678,11 +678,8 @@ HICON WINAPI CreateIconFromResourceEx( LPBYTE bits, UINT cbSize,
INT width, INT height, INT width, INT height,
UINT cFlag ) UINT cFlag )
{ {
TDB* pTask = (TDB*)GlobalLock16( GetCurrentTask() ); return CURSORICON_CreateFromResource( 0, 0, bits, cbSize, bIcon, dwVersion,
if( pTask ) width, height, cFlag );
return CURSORICON_CreateFromResource( pTask->hInstance, 0, bits, cbSize, bIcon, dwVersion,
width, height, cFlag );
return 0;
} }
/********************************************************************** /**********************************************************************
...@@ -810,7 +807,7 @@ static HGLOBAL16 CURSORICON_Copy( HINSTANCE16 hInstance, HGLOBAL16 handle ) ...@@ -810,7 +807,7 @@ static HGLOBAL16 CURSORICON_Copy( HINSTANCE16 hInstance, HGLOBAL16 handle )
HGLOBAL16 hNew; HGLOBAL16 hNew;
if (!(ptrOld = (char *)GlobalLock16( handle ))) return 0; if (!(ptrOld = (char *)GlobalLock16( handle ))) return 0;
if (!(hInstance = GetExePtr( hInstance ))) return 0; if (hInstance && !(hInstance = GetExePtr( hInstance ))) return 0;
size = GlobalSize16( handle ); size = GlobalSize16( handle );
hNew = GlobalAlloc16( GMEM_MOVEABLE, size ); hNew = GlobalAlloc16( GMEM_MOVEABLE, size );
FarSetOwner16( hNew, hInstance ); FarSetOwner16( hNew, hInstance );
...@@ -869,8 +866,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, ...@@ -869,8 +866,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType,
*/ */
if(pIconCache == NULL) if(pIconCache == NULL)
{ {
TDB* pTask = (TDB *) GlobalLock16 (GetCurrentTask ()); hNew = CURSORICON_Copy(0, Handle);
hNew = CURSORICON_Copy(pTask->hInstance, Handle);
if(nFlags & LR_COPYFROMRESOURCE) if(nFlags & LR_COPYFROMRESOURCE)
{ {
TRACE_(icon)("LR_COPYFROMRESOURCE: Failed to load from cache\n"); TRACE_(icon)("LR_COPYFROMRESOURCE: Failed to load from cache\n");
...@@ -959,11 +955,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType, ...@@ -959,11 +955,7 @@ HGLOBAL CURSORICON_ExtCopy(HGLOBAL Handle, UINT nType,
FreeResource(hMem); FreeResource(hMem);
} }
} }
else else hNew = CURSORICON_Copy(0, Handle);
{
TDB* pTask = (TDB *) GlobalLock16 (GetCurrentTask ());
hNew = CURSORICON_Copy(pTask->hInstance, Handle);
}
return hNew; return hNew;
} }
...@@ -977,14 +969,12 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent) ...@@ -977,14 +969,12 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent)
{ {
HCURSOR16 hRet = 0; HCURSOR16 hRet = 0;
CURSORICONINFO *pIcon = NULL; CURSORICONINFO *pIcon = NULL;
HTASK16 hTask = GetCurrentTask();
TDB* pTask = (TDB *)GlobalLock16(hTask);
if(hIcon && pTask) if(hIcon)
if (!(pIcon = (CURSORICONINFO*)GlobalLock16( hIcon ))) return FALSE; if (!(pIcon = (CURSORICONINFO*)GlobalLock16( hIcon ))) return FALSE;
if (pIcon->bPlanes * pIcon->bBitsPerPixel == 1) if (pIcon->bPlanes * pIcon->bBitsPerPixel == 1)
{ {
hRet = CURSORICON_Copy( pTask->hInstance, hIcon ); hRet = CURSORICON_Copy( 0, hIcon );
pIcon = GlobalLock16(hRet); pIcon = GlobalLock16(hRet);
...@@ -1052,10 +1042,10 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent) ...@@ -1052,10 +1042,10 @@ HCURSOR16 CURSORICON_IconToCursor(HICON16 hIcon, BOOL bSemiTransparent)
pxbPtr += 4; pxbPtr += 4;
} }
hRet = CreateCursorIconIndirect16( pTask->hInstance , &cI, pAndBits, pXorBits); hRet = CreateCursorIconIndirect16( 0 , &cI, pAndBits, pXorBits);
if( !hRet ) /* fall back on default drag cursor */ if( !hRet ) /* fall back on default drag cursor */
hRet = CURSORICON_Copy( pTask->hInstance , hRet = CURSORICON_Copy( 0 ,
CURSORICON_Load(0,MAKEINTRESOURCEW(OCR_DRAGOBJECT), CURSORICON_Load(0,MAKEINTRESOURCEW(OCR_DRAGOBJECT),
GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CXCURSOR),
GetSystemMetrics(SM_CYCURSOR), 1, TRUE, 0) ); GetSystemMetrics(SM_CYCURSOR), 1, TRUE, 0) );
...@@ -1201,7 +1191,7 @@ HGLOBAL16 WINAPI CreateCursorIconIndirect16( HINSTANCE16 hInstance, ...@@ -1201,7 +1191,7 @@ HGLOBAL16 WINAPI CreateCursorIconIndirect16( HINSTANCE16 hInstance,
if (!(handle = GlobalAlloc16( GMEM_MOVEABLE, if (!(handle = GlobalAlloc16( GMEM_MOVEABLE,
sizeof(CURSORICONINFO) + sizeXor + sizeAnd))) sizeof(CURSORICONINFO) + sizeXor + sizeAnd)))
return 0; return 0;
if (hInstance) FarSetOwner16( handle, hInstance ); FarSetOwner16( handle, hInstance );
ptr = (char *)GlobalLock16( handle ); ptr = (char *)GlobalLock16( handle );
memcpy( ptr, info, sizeof(*info) ); memcpy( ptr, info, sizeof(*info) );
memcpy( ptr + sizeof(CURSORICONINFO), lpANDbits, sizeAnd ); memcpy( ptr + sizeof(CURSORICONINFO), lpANDbits, sizeAnd );
...@@ -1226,10 +1216,8 @@ HICON16 WINAPI CopyIcon16( HINSTANCE16 hInstance, HICON16 hIcon ) ...@@ -1226,10 +1216,8 @@ HICON16 WINAPI CopyIcon16( HINSTANCE16 hInstance, HICON16 hIcon )
*/ */
HICON WINAPI CopyIcon( HICON hIcon ) HICON WINAPI CopyIcon( HICON hIcon )
{ {
HTASK16 hTask = GetCurrentTask ();
TDB* pTask = (TDB *) GlobalLock16 (hTask);
TRACE_(icon)("%04x\n", hIcon ); TRACE_(icon)("%04x\n", hIcon );
return CURSORICON_Copy( pTask->hInstance, hIcon ); return CURSORICON_Copy( 0, hIcon );
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "hook.h" #include "hook.h"
#include "message.h" #include "message.h"
#include "queue.h" #include "queue.h"
#include "task.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win); DEFAULT_DEBUG_CHANNEL(win);
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "hook.h" #include "hook.h"
#include "win.h" #include "win.h"
#include "queue.h" #include "queue.h"
#include "task.h"
#include "user.h" #include "user.h"
#include "heap.h" #include "heap.h"
#include "struct32.h" #include "struct32.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "queue.h" #include "queue.h"
#include "debugtools.h" #include "debugtools.h"
#include "winerror.h" #include "winerror.h"
#include "task.h"
DECLARE_DEBUG_CHANNEL(event); DECLARE_DEBUG_CHANNEL(event);
DECLARE_DEBUG_CHANNEL(key); DECLARE_DEBUG_CHANNEL(key);
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "dde.h" #include "dde.h"
#include "queue.h" #include "queue.h"
#include "winproc.h" #include "winproc.h"
#include "task.h"
#include "thread.h" #include "thread.h"
#include "options.h" #include "options.h"
#include "controls.h" #include "controls.h"
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "queue.h" #include "queue.h"
#include "task.h"
#include "win.h" #include "win.h"
#include "hook.h" #include "hook.h"
#include "heap.h" #include "heap.h"
...@@ -368,7 +367,6 @@ void QUEUE_DumpQueue( HQUEUE16 hQueue ) ...@@ -368,7 +367,6 @@ void QUEUE_DumpQueue( HQUEUE16 hQueue )
"lastMsg: %8p smPending: %10p\n" "lastMsg: %8p smPending: %10p\n"
"msgCount: %8.4x smProcessing: %10p\n" "msgCount: %8.4x smProcessing: %10p\n"
"lockCount: %7.4x\n" "lockCount: %7.4x\n"
"wWinVer: %9.4x\n"
"paints: %10.4x\n" "paints: %10.4x\n"
"timers: %10.4x\n" "timers: %10.4x\n"
"wakeBits: %8.4x\n" "wakeBits: %8.4x\n"
...@@ -376,8 +374,7 @@ void QUEUE_DumpQueue( HQUEUE16 hQueue ) ...@@ -376,8 +374,7 @@ void QUEUE_DumpQueue( HQUEUE16 hQueue )
"hCurHook: %8.4x\n", "hCurHook: %8.4x\n",
pq->next, pq->teb, pq->firstMsg, pq->smWaiting, pq->lastMsg, pq->next, pq->teb, pq->firstMsg, pq->smWaiting, pq->lastMsg,
pq->smPending, pq->msgCount, pq->smProcessing, pq->smPending, pq->msgCount, pq->smProcessing,
(unsigned)pq->lockCount, pq->wWinVersion, (unsigned)pq->lockCount, pq->wPaintCount, pq->wTimerCount,
pq->wPaintCount, pq->wTimerCount,
pq->wakeBits, pq->wakeMask, pq->hCurHook); pq->wakeBits, pq->wakeMask, pq->hCurHook);
QUEUE_Unlock( pq ); QUEUE_Unlock( pq );
...@@ -440,7 +437,6 @@ static HQUEUE16 QUEUE_CreateMsgQueue( BOOL16 bCreatePerQData ) ...@@ -440,7 +437,6 @@ static HQUEUE16 QUEUE_CreateMsgQueue( BOOL16 bCreatePerQData )
HQUEUE16 hQueue; HQUEUE16 hQueue;
HANDLE handle; HANDLE handle;
MESSAGEQUEUE * msgQueue; MESSAGEQUEUE * msgQueue;
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
TRACE_(msg)("(): Creating message queue...\n"); TRACE_(msg)("(): Creating message queue...\n");
...@@ -470,7 +466,6 @@ static HQUEUE16 QUEUE_CreateMsgQueue( BOOL16 bCreatePerQData ) ...@@ -470,7 +466,6 @@ static HQUEUE16 QUEUE_CreateMsgQueue( BOOL16 bCreatePerQData )
msgQueue->self = hQueue; msgQueue->self = hQueue;
msgQueue->wakeBits = msgQueue->changeBits = 0; msgQueue->wakeBits = msgQueue->changeBits = 0;
msgQueue->wWinVersion = pTask ? pTask->version : 0;
InitializeCriticalSection( &msgQueue->cSection ); InitializeCriticalSection( &msgQueue->cSection );
MakeCriticalSectionGlobal( &msgQueue->cSection ); MakeCriticalSectionGlobal( &msgQueue->cSection );
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "winuser.h" #include "winuser.h"
#include "queue.h" #include "queue.h"
#include "task.h"
#include "winproc.h" #include "winproc.h"
#include "services.h" #include "services.h"
#include "message.h" #include "message.h"
......
...@@ -137,8 +137,10 @@ static void USER_QueueCleanup( HQUEUE16 hQueue ) ...@@ -137,8 +137,10 @@ static void USER_QueueCleanup( HQUEUE16 hQueue )
/********************************************************************** /**********************************************************************
* USER_AppExit * USER_AppExit
*/ */
static void USER_AppExit( HINSTANCE16 hInstance ) static void USER_AppExit(void)
{ {
HINSTANCE16 hInstance = MapHModuleLS(0);
/* FIXME: maybe destroy menus (Windows only complains about them /* FIXME: maybe destroy menus (Windows only complains about them
* but does nothing); * but does nothing);
*/ */
...@@ -179,8 +181,6 @@ void WINAPI FinalUserInit16( void ) ...@@ -179,8 +181,6 @@ void WINAPI FinalUserInit16( void )
WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID, WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
DWORD dwFlags, HMODULE16 hModule ) DWORD dwFlags, HMODULE16 hModule )
{ {
HINSTANCE16 hInst;
/* FIXME: Proper reaction to most signals still missing. */ /* FIXME: Proper reaction to most signals still missing. */
switch ( uCode ) switch ( uCode )
...@@ -217,9 +217,8 @@ WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID, ...@@ -217,9 +217,8 @@ WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
case USIG_PROCESS_EXIT: case USIG_PROCESS_EXIT:
break; break;
case USIG_PROCESS_DESTROY: case USIG_PROCESS_DESTROY:
hInst = ((TDB *)GlobalLock16( GetCurrentTask() ))->hInstance; USER_AppExit();
USER_AppExit( hInst );
break; break;
default: default:
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "message.h" #include "message.h"
#include "queue.h" #include "queue.h"
#include "winpos.h" #include "winpos.h"
#include "task.h"
#include "thread.h" #include "thread.h"
#include "winerror.h" #include "winerror.h"
#include "stackframe.h" #include "stackframe.h"
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "message.h" #include "message.h"
#include "queue.h" #include "queue.h"
#include "options.h" #include "options.h"
#include "task.h"
#include "winpos.h" #include "winpos.h"
#include "dce.h" #include "dce.h"
#include "nonclient.h" #include "nonclient.h"
......
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