1996-03-14 19:08:34 +01:00
|
|
|
/*
|
|
|
|
* Message queues definitions
|
|
|
|
*
|
|
|
|
* Copyright 1993 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_QUEUE_H
|
|
|
|
#define __WINE_QUEUE_H
|
|
|
|
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
2000-03-08 19:26:56 +01:00
|
|
|
#include "winbase.h"
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "wingdi.h"
|
1999-02-21 19:23:26 +01:00
|
|
|
#include "winuser.h"
|
1999-01-26 10:30:05 +01:00
|
|
|
#include "thread.h"
|
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
|
|
|
|
/* Message as stored in the queue (contains the extraInfo field) */
|
|
|
|
typedef struct tagQMSG
|
|
|
|
{
|
2001-06-19 21:16:41 +02:00
|
|
|
int kind; /* message kind (sent,posted,hardware) */
|
1999-12-10 04:47:13 +01:00
|
|
|
int type;
|
1999-02-26 12:11:13 +01:00
|
|
|
MSG msg;
|
1999-12-10 04:47:13 +01:00
|
|
|
DWORD extraInfo; /* Only in 3.1 */
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
struct tagQMSG *nextMsg;
|
|
|
|
struct tagQMSG *prevMsg;
|
1996-03-14 19:08:34 +01:00
|
|
|
} QMSG;
|
|
|
|
|
1999-12-10 04:47:13 +01:00
|
|
|
#define QMSG_WIN16 0
|
|
|
|
#define QMSG_WIN32A 1
|
|
|
|
#define QMSG_WIN32W 2
|
|
|
|
#define QMSG_HARDWARE 3
|
|
|
|
|
1999-02-18 18:34:09 +01:00
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Per-queue data for the message queue
|
|
|
|
* Note that we currently only store the current values for
|
|
|
|
* Active, Capture and Focus windows currently.
|
|
|
|
* It might be necessary to store a pointer to the system message queue
|
|
|
|
* as well since windows 9x maintains per thread system message queues
|
|
|
|
*/
|
1999-01-26 10:30:05 +01:00
|
|
|
typedef struct tagPERQUEUEDATA
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND hWndFocus; /* Focus window */
|
|
|
|
HWND hWndActive; /* Active window */
|
|
|
|
HWND hWndCapture; /* Capture window */
|
1999-02-05 11:37:53 +01:00
|
|
|
INT16 nCaptureHT; /* Capture info (hit-test) */
|
|
|
|
ULONG ulRefCount; /* Reference count */
|
|
|
|
CRITICAL_SECTION cSection; /* Critical section for thread safe access */
|
1999-01-26 10:30:05 +01:00
|
|
|
} PERQUEUEDATA;
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Message queue */
|
1996-03-14 19:08:34 +01:00
|
|
|
typedef struct tagMESSAGEQUEUE
|
|
|
|
{
|
1999-01-26 10:30:05 +01:00
|
|
|
HQUEUE16 self; /* Handle to self (was: reserved) */
|
1999-06-22 13:43:42 +02:00
|
|
|
TEB* teb; /* Thread owning queue */
|
2000-05-30 21:48:18 +02:00
|
|
|
HANDLE server_queue; /* Handle to server-side queue */
|
1999-01-26 10:30:05 +01:00
|
|
|
CRITICAL_SECTION cSection; /* Queue access critical section */
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
DWORD magic; /* magic number should be QUEUE_MAGIC */
|
|
|
|
DWORD lockCount; /* reference counter */
|
1999-01-26 10:30:05 +01:00
|
|
|
|
|
|
|
QMSG* firstMsg; /* First message in linked list */
|
|
|
|
QMSG* lastMsg; /* Last message in linked list */
|
|
|
|
|
|
|
|
WORD wPostQMsg; /* PostQuitMessage flag */
|
|
|
|
WORD wExitCode; /* PostQuitMessage exit code */
|
|
|
|
WORD wPaintCount; /* Number of WM_PAINT needed */
|
|
|
|
|
|
|
|
DWORD GetMessageTimeVal; /* Value for GetMessageTime */
|
|
|
|
DWORD GetMessagePosVal; /* Value for GetMessagePos */
|
|
|
|
DWORD GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
|
2001-05-19 00:51:56 +02:00
|
|
|
|
1999-01-26 10:30:05 +01:00
|
|
|
HANDLE16 hCurHook; /* Current hook */
|
|
|
|
HANDLE16 hooks[WH_NB_HOOKS]; /* Task hooks list */
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
PERQUEUEDATA *pQData; /* pointer to (shared) PERQUEUEDATA structure */
|
1999-01-26 10:30:05 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
} MESSAGEQUEUE;
|
|
|
|
|
|
|
|
|
1999-01-28 11:54:11 +01:00
|
|
|
#define QUEUE_MAGIC 0xD46E80AF
|
|
|
|
|
1999-02-05 11:37:53 +01:00
|
|
|
/* Per queue data management methods */
|
1999-02-19 17:29:05 +01:00
|
|
|
PERQUEUEDATA* PERQDATA_CreateInstance( void );
|
1999-02-05 11:37:53 +01:00
|
|
|
ULONG PERQDATA_Addref( PERQUEUEDATA* pQData );
|
|
|
|
ULONG PERQDATA_Release( PERQUEUEDATA* pQData );
|
1999-02-26 12:11:13 +01:00
|
|
|
HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
|
|
|
|
HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
|
|
|
|
HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
|
|
|
|
HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
|
|
|
|
HWND PERQDATA_GetCaptureWnd( PERQUEUEDATA *pQData );
|
|
|
|
HWND PERQDATA_SetCaptureWnd( PERQUEUEDATA *pQData, HWND hWndCapture );
|
1999-02-05 11:37:53 +01:00
|
|
|
INT16 PERQDATA_GetCaptureInfo( PERQUEUEDATA *pQData );
|
|
|
|
INT16 PERQDATA_SetCaptureInfo( PERQUEUEDATA *pQData, INT16 nCaptureHT );
|
|
|
|
|
|
|
|
/* Message queue management methods */
|
1999-01-28 11:54:11 +01:00
|
|
|
extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
|
|
|
|
extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
|
1996-07-12 21:02:39 +02:00
|
|
|
extern void QUEUE_DumpQueue( HQUEUE16 hQueue );
|
1999-02-26 12:11:13 +01:00
|
|
|
extern BOOL QUEUE_IsExitingQueue( HQUEUE16 hQueue );
|
1997-05-25 15:58:18 +02:00
|
|
|
extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue );
|
2001-05-19 00:51:56 +02:00
|
|
|
extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD set, WORD clear );
|
1996-06-16 18:16:05 +02:00
|
|
|
extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
|
1999-03-10 17:21:12 +01:00
|
|
|
extern int QUEUE_WaitBits( WORD bits, DWORD timeout );
|
1996-07-12 21:02:39 +02:00
|
|
|
extern void QUEUE_IncPaintCount( HQUEUE16 hQueue );
|
|
|
|
extern void QUEUE_DecPaintCount( HQUEUE16 hQueue );
|
1999-02-26 12:11:13 +01:00
|
|
|
extern BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
|
1996-07-12 21:02:39 +02:00
|
|
|
extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
|
2001-06-19 21:16:41 +02:00
|
|
|
extern BOOL QUEUE_FindMsg( HWND hwnd, UINT first, UINT last, BOOL remove, QMSG *msg );
|
1999-01-26 10:30:05 +01:00
|
|
|
extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, QMSG *qmsg );
|
2001-05-19 00:51:56 +02:00
|
|
|
extern void QUEUE_CleanupWindow( HWND hwnd );
|
1996-03-14 19:08:34 +01:00
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
extern HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags );
|
1998-12-24 16:15:00 +01:00
|
|
|
|
1996-03-14 19:08:34 +01:00
|
|
|
#endif /* __WINE_QUEUE_H */
|