Queue handling adapted to new queue routines.

This commit is contained in:
Ulrich Weigand 1998-12-24 15:16:08 +00:00 committed by Alexandre Julliard
parent 89b93bf26b
commit 1babe5b23c
4 changed files with 25 additions and 20 deletions

View File

@ -16,6 +16,8 @@
#include "win.h" #include "win.h"
#include "heap.h" #include "heap.h"
#include "message.h" #include "message.h"
#include "queue.h"
#include "task.h"
#include "clipboard.h" #include "clipboard.h"
#include "xmalloc.h" #include "xmalloc.h"
#include "debug.h" #include "debug.h"
@ -183,7 +185,7 @@ BOOL32 WINAPI OpenClipboard32( HWND32 hWnd )
if (!hqClipLock) if (!hqClipLock)
{ {
hqClipLock = GetTaskQueue(0); hqClipLock = GetFastQueue();
hWndClipWindow = hWnd; hWndClipWindow = hWnd;
bCBHasChanged = FALSE; bCBHasChanged = FALSE;
bRet = TRUE; bRet = TRUE;
@ -211,7 +213,7 @@ BOOL32 WINAPI CloseClipboard32(void)
{ {
TRACE(clipboard,"!\n"); TRACE(clipboard,"!\n");
if (hqClipLock == GetTaskQueue(0)) if (hqClipLock == GetFastQueue())
{ {
hWndClipWindow = 0; hWndClipWindow = 0;
@ -241,7 +243,7 @@ BOOL32 WINAPI EmptyClipboard32(void)
TRACE(clipboard,"(void)\n"); TRACE(clipboard,"(void)\n");
if (hqClipLock != GetTaskQueue(0)) return FALSE; if (hqClipLock != GetFastQueue()) return FALSE;
/* destroy private objects */ /* destroy private objects */
@ -298,7 +300,7 @@ HANDLE16 WINAPI SetClipboardData16( UINT16 wFormat, HANDLE16 hData )
* adding new data). * adding new data).
*/ */
if( (hqClipLock != GetTaskQueue(0)) || !lpFormat || if( (hqClipLock != GetFastQueue()) || !lpFormat ||
(!hData && (!hWndClipOwner || (hWndClipOwner != hWndClipWindow))) ) return 0; (!hData && (!hWndClipOwner || (hWndClipOwner != hWndClipWindow))) ) return 0;
CLIPBOARD_GetDriver()->pSetClipboardData(wFormat); CLIPBOARD_GetDriver()->pSetClipboardData(wFormat);
@ -346,7 +348,7 @@ HANDLE32 WINAPI SetClipboardData32( UINT32 wFormat, HANDLE32 hData )
* adding new data). * adding new data).
*/ */
if( (hqClipLock != GetTaskQueue(0)) || !lpFormat || if( (hqClipLock != GetFastQueue()) || !lpFormat ||
(!hData && (!hWndClipOwner || (hWndClipOwner != hWndClipWindow))) ) return 0; (!hData && (!hWndClipOwner || (hWndClipOwner != hWndClipWindow))) ) return 0;
CLIPBOARD_GetDriver()->pSetClipboardData(wFormat); CLIPBOARD_GetDriver()->pSetClipboardData(wFormat);
@ -459,7 +461,7 @@ HANDLE16 WINAPI GetClipboardData16( UINT16 wFormat )
LPCLIPFORMAT lpRender = ClipFormats; LPCLIPFORMAT lpRender = ClipFormats;
LPCLIPFORMAT lpUpdate = NULL; LPCLIPFORMAT lpUpdate = NULL;
if (hqClipLock != GetTaskQueue(0)) return 0; if (hqClipLock != GetFastQueue()) return 0;
TRACE(clipboard,"(%04X)\n", wFormat); TRACE(clipboard,"(%04X)\n", wFormat);
@ -535,7 +537,7 @@ HANDLE32 WINAPI GetClipboardData32( UINT32 wFormat )
LPCLIPFORMAT lpRender = ClipFormats; LPCLIPFORMAT lpRender = ClipFormats;
LPCLIPFORMAT lpUpdate = NULL; LPCLIPFORMAT lpUpdate = NULL;
if (hqClipLock != GetTaskQueue(0)) return 0; if (hqClipLock != GetFastQueue()) return 0;
TRACE(clipboard,"(%08X)\n", wFormat); TRACE(clipboard,"(%08X)\n", wFormat);
@ -656,7 +658,7 @@ UINT32 WINAPI EnumClipboardFormats32( UINT32 wFormat )
TRACE(clipboard,"(%04X)\n", wFormat); TRACE(clipboard,"(%04X)\n", wFormat);
if( hqClipLock != GetTaskQueue(0) ) return 0; if( hqClipLock != GetFastQueue() ) return 0;
if( (!wFormat || wFormat == CF_TEXT || wFormat == CF_OEMTEXT) ) if( (!wFormat || wFormat == CF_TEXT || wFormat == CF_OEMTEXT) )
CLIPBOARD_GetDriver()->pRequestSelection(); CLIPBOARD_GetDriver()->pRequestSelection();

View File

@ -17,6 +17,7 @@
#include "windows.h" #include "windows.h"
#include "hook.h" #include "hook.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"
@ -976,7 +977,7 @@ static LRESULT HOOK_CallHook( HANDLE16 hook, INT32 fromtype, INT32 code,
/* Now call it */ /* Now call it */
if (!(queue = (MESSAGEQUEUE *)GlobalLock16( GetTaskQueue(0) ))) return 0; if (!(queue = (MESSAGEQUEUE *)GlobalLock16( GetThreadQueue(0) ))) return 0;
prevHook = queue->hCurHook; prevHook = queue->hCurHook;
queue->hCurHook = hook; queue->hCurHook = hook;
data->flags |= HOOK_INUSE; data->flags |= HOOK_INUSE;
@ -1025,7 +1026,7 @@ HOOKPROC16 HOOK_GetProc16( HHOOK hhook )
*/ */
BOOL32 HOOK_IsHooked( INT16 id ) BOOL32 HOOK_IsHooked( INT16 id )
{ {
return HOOK_GetHook( id, GetTaskQueue(0) ) != 0; return HOOK_GetHook( id, GetThreadQueue(0) ) != 0;
} }
@ -1039,7 +1040,7 @@ LRESULT HOOK_CallHooks16( INT16 id, INT16 code, WPARAM16 wParam,
{ {
HANDLE16 hook; HANDLE16 hook;
if (!(hook = HOOK_GetHook( id , GetTaskQueue(0) ))) return 0; if (!(hook = HOOK_GetHook( id , GetThreadQueue(0) ))) return 0;
if (!(hook = HOOK_FindValidHook(hook))) return 0; if (!(hook = HOOK_FindValidHook(hook))) return 0;
return HOOK_CallHook( hook, HOOK_WIN16, code, wParam, lParam ); return HOOK_CallHook( hook, HOOK_WIN16, code, wParam, lParam );
} }
@ -1054,7 +1055,7 @@ LRESULT HOOK_CallHooks32A( INT32 id, INT32 code, WPARAM32 wParam,
{ {
HANDLE16 hook; HANDLE16 hook;
if (!(hook = HOOK_GetHook( id , GetTaskQueue(0) ))) return 0; if (!(hook = HOOK_GetHook( id , GetThreadQueue(0) ))) return 0;
if (!(hook = HOOK_FindValidHook(hook))) return 0; if (!(hook = HOOK_FindValidHook(hook))) return 0;
return HOOK_CallHook( hook, HOOK_WIN32A, code, wParam, lParam ); return HOOK_CallHook( hook, HOOK_WIN32A, code, wParam, lParam );
} }
@ -1069,7 +1070,7 @@ LRESULT HOOK_CallHooks32W( INT32 id, INT32 code, WPARAM32 wParam,
{ {
HANDLE16 hook; HANDLE16 hook;
if (!(hook = HOOK_GetHook( id , GetTaskQueue(0) ))) return 0; if (!(hook = HOOK_GetHook( id , GetThreadQueue(0) ))) return 0;
if (!(hook = HOOK_FindValidHook(hook))) return 0; if (!(hook = HOOK_FindValidHook(hook))) return 0;
return HOOK_CallHook( hook, HOOK_WIN32W, code, wParam, return HOOK_CallHook( hook, HOOK_WIN32W, code, wParam,
lParam ); lParam );
@ -1268,7 +1269,7 @@ HHOOK WINAPI SetWindowsHookEx32W( INT32 id, HOOKPROC32 proc, HINSTANCE32 hInst,
*/ */
BOOL16 WINAPI UnhookWindowsHook16( INT16 id, HOOKPROC16 proc ) BOOL16 WINAPI UnhookWindowsHook16( INT16 id, HOOKPROC16 proc )
{ {
HANDLE16 hook = HOOK_GetHook( id , GetTaskQueue(0) ); HANDLE16 hook = HOOK_GetHook( id, GetThreadQueue(0) );
TRACE(hook, "%d %08lx\n", id, (DWORD)proc ); TRACE(hook, "%d %08lx\n", id, (DWORD)proc );
@ -1288,7 +1289,7 @@ BOOL16 WINAPI UnhookWindowsHook16( INT16 id, HOOKPROC16 proc )
*/ */
BOOL32 WINAPI UnhookWindowsHook32( INT32 id, HOOKPROC32 proc ) BOOL32 WINAPI UnhookWindowsHook32( INT32 id, HOOKPROC32 proc )
{ {
HANDLE16 hook = HOOK_GetHook( id , GetTaskQueue(0) ); HANDLE16 hook = HOOK_GetHook( id, GetThreadQueue(0) );
TRACE(hook, "%d %08lx\n", id, (DWORD)proc ); TRACE(hook, "%d %08lx\n", id, (DWORD)proc );
@ -1375,7 +1376,7 @@ LRESULT WINAPI DefHookProc16( INT16 code, WPARAM16 wParam, LPARAM lParam,
* current hook value from the task queue to find the next hook. */ * current hook value from the task queue to find the next hook. */
MESSAGEQUEUE *queue; MESSAGEQUEUE *queue;
if (!(queue = (MESSAGEQUEUE *)GlobalLock16( GetTaskQueue(0) ))) return 0; if (!(queue = (MESSAGEQUEUE *)GlobalLock16( GetThreadQueue(0) ))) return 0;
return CallNextHookEx16( queue->hCurHook, code, wParam, lParam ); return CallNextHookEx16( queue->hCurHook, code, wParam, lParam );
} }

View File

@ -6,6 +6,7 @@
#include "windows.h" #include "windows.h"
#include "queue.h" #include "queue.h"
#include "task.h"
#include "winproc.h" #include "winproc.h"
#include "debug.h" #include "debug.h"
@ -254,8 +255,8 @@ static UINT32 TIMER_SetTimer( HWND32 hwnd, UINT32 id, UINT32 timeout,
/* Add the timer */ /* Add the timer */
pTimer->hwnd = hwnd; pTimer->hwnd = hwnd;
pTimer->hq = (hwnd) ? GetTaskQueue( GetWindowTask16( hwnd ) ) pTimer->hq = (hwnd) ? GetThreadQueue( GetWindowThreadProcessId( hwnd, NULL ) )
: GetTaskQueue( 0 ); : GetFastQueue( );
pTimer->msg = sys ? WM_SYSTIMER : WM_TIMER; pTimer->msg = sys ? WM_SYSTIMER : WM_TIMER;
pTimer->id = id; pTimer->id = id;
pTimer->timeout = timeout; pTimer->timeout = timeout;

View File

@ -15,6 +15,7 @@
#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"
@ -409,7 +410,7 @@ hittest:
if (!*ppWnd) *ppWnd = wndScope; if (!*ppWnd) *ppWnd = wndScope;
/* Send the WM_NCHITTEST message (only if to the same task) */ /* Send the WM_NCHITTEST message (only if to the same task) */
if ((*ppWnd)->hmemTaskQ == GetTaskQueue(0)) if ((*ppWnd)->hmemTaskQ == GetFastQueue())
{ {
hittest = (INT16)SendMessage16( (*ppWnd)->hwndSelf, WM_NCHITTEST, hittest = (INT16)SendMessage16( (*ppWnd)->hwndSelf, WM_NCHITTEST,
0, MAKELONG( pt.x, pt.y ) ); 0, MAKELONG( pt.x, pt.y ) );
@ -1449,7 +1450,7 @@ BOOL32 WINPOS_SetActiveWindow( HWND32 hWnd, BOOL32 fMouse, BOOL32 fChangeFocus)
/* paranoid checks */ /* paranoid checks */
if( hWnd == GetDesktopWindow32() || hWnd == hwndActive ) return 0; if( hWnd == GetDesktopWindow32() || hWnd == hwndActive ) return 0;
/* if (wndPtr && (GetTaskQueue(0) != wndPtr->hmemTaskQ)) /* if (wndPtr && (GetFastQueue() != wndPtr->hmemTaskQ))
* return 0; * return 0;
*/ */
wndPtr = WIN_FindWndPtr(hWnd); wndPtr = WIN_FindWndPtr(hWnd);