From d8bbcb2f231133d5e81c64d3e82cfe4506cd5d71 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 23 Oct 2002 18:56:02 +0000 Subject: [PATCH] Implemented GetWindowTask16 on top of GetWindowThreadProcessId. Removed no longer used hmemTaskQ field in WND structure. --- dlls/user/user32.spec | 1 - dlls/user/wnd16.c | 10 ++++++++++ dlls/x11drv/desktop.c | 1 - include/queue.h | 1 - include/win.h | 1 - windows/queue.c | 23 ----------------------- windows/win.c | 3 --- 7 files changed, 10 insertions(+), 30 deletions(-) diff --git a/dlls/user/user32.spec b/dlls/user/user32.spec index 70e53a715d5..5c8c9dee020 100644 --- a/dlls/user/user32.spec +++ b/dlls/user/user32.spec @@ -672,7 +672,6 @@ init UserClientDllInitialize @ stdcall DestroyIcon32(long long) DestroyIcon32 @ stdcall DialogBoxIndirectParam16(long long long long long) DialogBoxIndirectParam16 @ stdcall GetDriverModuleHandle16(long) GetDriverModuleHandle16 -@ stdcall InitThreadInput16(long long) InitThreadInput16 @ stdcall OpenDriver16(str str long) OpenDriver16 @ stdcall PostAppMessage16(long long long long) PostAppMessage16 @ stdcall SendDriverMessage16(long long long long) SendDriverMessage16 diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c index f6479b98857..dd9b28342b7 100644 --- a/dlls/user/wnd16.c +++ b/dlls/user/wnd16.c @@ -1026,6 +1026,16 @@ INT16 WINAPI DlgDirListComboBox16( HWND16 hDlg, LPSTR spec, INT16 idCBox, } +/*********************************************************************** + * GetWindowTask (USER.224) + */ +HTASK16 WINAPI GetWindowTask16( HWND16 hwnd ) +{ + DWORD tid = GetWindowThreadProcessId( HWND_32(hwnd), NULL ); + if (!tid) return 0; + return HTASK_16(tid); +} + /********************************************************************** * EnumTaskWindows (USER.225) */ diff --git a/dlls/x11drv/desktop.c b/dlls/x11drv/desktop.c index ede6dae9975..1e452f024b4 100644 --- a/dlls/x11drv/desktop.c +++ b/dlls/x11drv/desktop.c @@ -70,7 +70,6 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data ) /* patch the desktop window queue to point to our queue */ win = WIN_GetPtr( hwnd ); win->tid = GetCurrentThreadId(); - win->hmemTaskQ = InitThreadInput16( 0, 0 ); X11DRV_register_window( display, hwnd, win->pDriverData ); WIN_ReleasePtr( win ); diff --git a/include/queue.h b/include/queue.h index b1eb20c0433..1aeb917fa35 100644 --- a/include/queue.h +++ b/include/queue.h @@ -35,7 +35,6 @@ struct received_message_info; typedef struct tagMESSAGEQUEUE { HQUEUE16 self; /* Handle to self (was: reserved) */ - TEB* teb; /* Thread owning queue */ HANDLE server_queue; /* Handle to server-side queue */ DWORD recursion_count; /* Counter to prevent infinite SendMessage recursion */ struct received_message_info *receive_info; /* Info about message being currently received */ diff --git a/include/win.h b/include/win.h index c9fc3d32721..d9203c555f1 100644 --- a/include/win.h +++ b/include/win.h @@ -52,7 +52,6 @@ typedef struct tagWND void *pVScroll; /* Vertical scroll-bar info */ void *pHScroll; /* Horizontal scroll-bar info */ struct tagDCE *dce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */ - HGLOBAL16 hmemTaskQ; /* Task queue global memory handle */ HRGN hrgnUpdate; /* Update region */ HRGN hrgnWnd; /* window's region */ DWORD dwStyle; /* Window style (from CreateWindow) */ diff --git a/windows/queue.c b/windows/queue.c index f6d5bb8e9b8..178efefac14 100644 --- a/windows/queue.c +++ b/windows/queue.c @@ -192,28 +192,6 @@ void QUEUE_DeleteMsgQueue(void) /*********************************************************************** - * GetWindowTask (USER.224) - */ -HTASK16 WINAPI GetWindowTask16( HWND16 hwnd ) -{ - HTASK16 retvalue; - MESSAGEQUEUE *queue; - - WND *wndPtr = WIN_FindWndPtr16( hwnd ); - if (!wndPtr) return 0; - - queue = QUEUE_Lock( wndPtr->hmemTaskQ ); - WIN_ReleaseWndPtr(wndPtr); - - if (!queue) return 0; - - retvalue = queue->teb->htask16; - QUEUE_Unlock( queue ); - - return retvalue; -} - -/*********************************************************************** * InitThreadInput (USER.409) */ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags ) @@ -232,7 +210,6 @@ HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags ) /* Link new queue into list */ queuePtr = QUEUE_Lock( hQueue ); - queuePtr->teb = NtCurrentTeb(); HeapLock( GetProcessHeap() ); /* FIXME: a bit overkill */ SetThreadQueue16( 0, hQueue ); diff --git a/windows/win.c b/windows/win.c index 596449d4574..f8ba77acdb2 100644 --- a/windows/win.c +++ b/windows/win.c @@ -684,7 +684,6 @@ LRESULT WIN_DestroyWindow( HWND hwnd ) TIMER_RemoveWindowTimers( hwnd ); if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0; - wndPtr->hmemTaskQ = 0; if (!(wndPtr->dwStyle & WS_CHILD)) { @@ -761,7 +760,6 @@ BOOL WIN_CreateDesktopWindow(void) pWndDesktop->owner = 0; pWndDesktop->class = class; pWndDesktop->text = NULL; - pWndDesktop->hmemTaskQ = 0; pWndDesktop->hrgnUpdate = 0; pWndDesktop->clsStyle = clsStyle; pWndDesktop->dce = NULL; @@ -1100,7 +1098,6 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, wndPtr->winproc = winproc; wndPtr->hInstance = cs->hInstance; wndPtr->text = NULL; - wndPtr->hmemTaskQ = InitThreadInput16( 0, 0 ); wndPtr->hrgnUpdate = 0; wndPtr->hrgnWnd = 0; wndPtr->dwStyle = cs->style & ~WS_VISIBLE; -- 2.11.4.GIT