2 * Message queues definitions
4 * Copyright 1993 Alexandre Julliard
12 /* Message as stored in the queue (contains the extraInfo field) */
13 typedef struct tagQMSG
15 DWORD extraInfo; /* Only in 3.1 */
27 typedef struct tagMESSAGEQUEUE
29 HQUEUE16 next; /* 00 Next queue */
30 HTASK16 hTask; /* 02 hTask owning the queue */
31 WORD msgSize; /* 04 Size of messages in the queue */
32 WORD msgCount; /* 06 Number of waiting messages */
33 WORD nextMessage; /* 08 Next message to be retrieved */
34 WORD nextFreeMessage; /* 0a Next available slot in the queue */
35 WORD queueSize; /* 0c Size of the queue */
36 DWORD GetMessageTimeVal WINE_PACKED; /* 0e Value for GetMessageTime */
37 DWORD GetMessagePosVal WINE_PACKED; /* 12 Value for GetMessagePos */
38 HQUEUE16 self; /* 16 Handle to self (was: reserved) */
39 DWORD GetMessageExtraInfoVal; /* 18 Value for GetMessageExtraInfo */
40 WORD reserved2; /* 1c Unknown */
41 LPARAM lParam WINE_PACKED; /* 1e Next 4 values set by SendMessage */
42 WPARAM16 wParam; /* 22 */
45 DWORD SendMessageReturn; /* 28 Return value for SendMessage */
46 WORD wPostQMsg; /* 2c PostQuitMessage flag */
47 WORD wExitCode; /* 2e PostQuitMessage exit code */
48 WORD flags; /* 30 Queue flags */
49 QSMCTRL* smResultInit; /* 32 1st LRESULT ptr - was: reserved */
50 WORD wWinVersion; /* 36 Expected Windows version */
51 HQUEUE16 InSendMessageHandle; /* 38 Queue of task that sent a message */
52 HTASK16 hSendingTask; /* 3a Handle of task that sent a message */
53 HTASK16 hPrevSendingTask; /* 3c Handle of previous sender */
54 WORD wPaintCount; /* 3e Number of WM_PAINT needed */
55 WORD wTimerCount; /* 40 Number of timers for this task */
56 WORD changeBits; /* 42 Changed wake-up bits */
57 WORD wakeBits; /* 44 Queue wake-up bits */
58 WORD wakeMask; /* 46 Queue wake-up mask */
59 QSMCTRL* smResultCurrent; /* 48 ptrs to SendMessage() LRESULT - point to */
60 WORD SendMsgReturnPtr[1]; /* values on stack */
61 HANDLE16 hCurHook; /* 4e Current hook */
62 HANDLE16 hooks[WH_NB_HOOKS]; /* 50 Task hooks list */
63 QSMCTRL* smResult; /* 6c 3rd LRESULT ptr - was: reserved */
64 QMSG messages[1]; /* 70 Queue messages */
69 /* Extra (undocumented) queue wake bits - see "Undoc. Windows" */
70 #define QS_SMRESULT 0x8000 /* Queue has a SendMessage() result */
71 #define QS_SMPARAMSFREE 0x4000 /* SendMessage() parameters are available */
74 #define QUEUE_FLAG_XEVENT 0x0001
76 extern void QUEUE_DumpQueue( HQUEUE16 hQueue );
77 extern void QUEUE_WalkQueues(void);
78 extern BOOL32 QUEUE_IsDoomedQueue( HQUEUE16 hQueue );
79 extern void QUEUE_SetDoomedQueue( HQUEUE16 hQueue );
80 extern MESSAGEQUEUE *QUEUE_GetSysQueue(void);
81 extern void QUEUE_SetWakeBit( MESSAGEQUEUE *queue, WORD bit );
82 extern void QUEUE_ClearWakeBit( MESSAGEQUEUE *queue, WORD bit );
83 extern void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue );
84 extern void QUEUE_WaitBits( WORD bits );
85 extern void QUEUE_IncPaintCount( HQUEUE16 hQueue );
86 extern void QUEUE_DecPaintCount( HQUEUE16 hQueue );
87 extern void QUEUE_IncTimerCount( HQUEUE16 hQueue );
88 extern void QUEUE_DecTimerCount( HQUEUE16 hQueue );
89 extern BOOL32 QUEUE_CreateSysMsgQueue( int size );
90 extern BOOL32 QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
91 extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
92 extern BOOL32 QUEUE_AddMsg( HQUEUE16 hQueue, MSG16 * msg, DWORD extraInfo );
93 extern int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND32 hwnd,
94 int first, int last );
95 extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos );
96 extern void hardware_event( WORD message, WORD wParam, LONG lParam,
97 int xPos, int yPos, DWORD time, DWORD extraInfo );
99 #endif /* __WINE_QUEUE_H */