Fixed atom test to work on Windows.
[wine/multimedia.git] / include / queue.h
blob76b0089782214e8f1bc2378f9922295202aaa42d
1 /*
2 * Message queues definitions
4 * Copyright 1993 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_QUEUE_H
22 #define __WINE_QUEUE_H
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "thread.h"
30 #define WH_NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
32 /* Per-queue data for the message queue
33 * Note that we currently only store the current values for
34 * Active, Capture and Focus windows currently.
35 * It might be necessary to store a pointer to the system message queue
36 * as well since windows 9x maintains per thread system message queues
38 typedef struct tagPERQUEUEDATA
40 HWND hWndFocus; /* Focus window */
41 HWND hWndActive; /* Active window */
42 HWND hWndCapture; /* Capture window */
43 INT16 nCaptureHT; /* Capture info (hit-test) */
44 ULONG ulRefCount; /* Reference count */
45 CRITICAL_SECTION cSection; /* Critical section for thread safe access */
46 } PERQUEUEDATA;
48 struct received_message_info;
50 /* Message queue */
51 typedef struct tagMESSAGEQUEUE
53 HQUEUE16 self; /* Handle to self (was: reserved) */
54 TEB* teb; /* Thread owning queue */
55 HANDLE server_queue; /* Handle to server-side queue */
56 struct received_message_info *receive_info; /* Info about message being currently received */
58 DWORD magic; /* magic number should be QUEUE_MAGIC */
59 DWORD lockCount; /* reference counter */
61 DWORD GetMessageTimeVal; /* Value for GetMessageTime */
62 DWORD GetMessagePosVal; /* Value for GetMessagePos */
63 DWORD GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
65 HCURSOR cursor; /* current cursor */
66 INT cursor_count; /* cursor show count */
68 HANDLE16 hCurHook; /* Current hook */
69 HANDLE16 hooks[WH_NB_HOOKS]; /* Task hooks list */
71 PERQUEUEDATA *pQData; /* pointer to (shared) PERQUEUEDATA structure */
73 } MESSAGEQUEUE;
76 #define QUEUE_MAGIC 0xD46E80AF
78 /* Per queue data management methods */
79 HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
80 HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
81 HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
82 HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
83 HWND PERQDATA_GetCaptureWnd( INT *hittest );
84 HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest );
86 /* Message queue management methods */
87 extern MESSAGEQUEUE *QUEUE_Current(void);
88 extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
89 extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
90 extern void QUEUE_DeleteMsgQueue(void);
92 #endif /* __WINE_QUEUE_H */