The 'dword' values should be stored as big endian values.
[wine/multimedia.git] / include / queue.h
blob9a14ccdd6e83bf0c172fa222b48fdcd11d304983
1 /*
2 * Message queues definitions
4 * Copyright 1993 Alexandre Julliard
5 */
7 #ifndef __WINE_QUEUE_H
8 #define __WINE_QUEUE_H
10 #include "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winuser.h"
14 #include "thread.h"
16 #define WH_NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
18 /* Per-queue data for the message queue
19 * Note that we currently only store the current values for
20 * Active, Capture and Focus windows currently.
21 * It might be necessary to store a pointer to the system message queue
22 * as well since windows 9x maintains per thread system message queues
24 typedef struct tagPERQUEUEDATA
26 HWND hWndFocus; /* Focus window */
27 HWND hWndActive; /* Active window */
28 HWND hWndCapture; /* Capture window */
29 INT16 nCaptureHT; /* Capture info (hit-test) */
30 ULONG ulRefCount; /* Reference count */
31 CRITICAL_SECTION cSection; /* Critical section for thread safe access */
32 } PERQUEUEDATA;
34 struct received_message_info;
36 /* Message queue */
37 typedef struct tagMESSAGEQUEUE
39 HQUEUE16 self; /* Handle to self (was: reserved) */
40 TEB* teb; /* Thread owning queue */
41 HANDLE server_queue; /* Handle to server-side queue */
42 struct received_message_info *receive_info; /* Info about message being currently received */
44 DWORD magic; /* magic number should be QUEUE_MAGIC */
45 DWORD lockCount; /* reference counter */
47 DWORD GetMessageTimeVal; /* Value for GetMessageTime */
48 DWORD GetMessagePosVal; /* Value for GetMessagePos */
49 DWORD GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
51 HANDLE16 hCurHook; /* Current hook */
52 HANDLE16 hooks[WH_NB_HOOKS]; /* Task hooks list */
54 PERQUEUEDATA *pQData; /* pointer to (shared) PERQUEUEDATA structure */
56 } MESSAGEQUEUE;
59 #define QUEUE_MAGIC 0xD46E80AF
61 /* Per queue data management methods */
62 HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
63 HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
64 HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
65 HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
66 HWND PERQDATA_GetCaptureWnd( INT *hittest );
67 HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest );
69 /* Message queue management methods */
70 extern MESSAGEQUEUE *QUEUE_Current(void);
71 extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
72 extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
73 extern void QUEUE_DeleteMsgQueue(void);
75 #endif /* __WINE_QUEUE_H */