Fixed some issues found by winapi_check.
[wine] / include / queue.h
1 /*
2  * Message queues definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  */
6
7 #ifndef __WINE_QUEUE_H
8 #define __WINE_QUEUE_H
9
10 #include "windef.h"
11 #include "winbase.h"
12 #include "wingdi.h"
13 #include "winuser.h"
14 #include "thread.h"
15
16
17 /* Per-queue data for the message queue
18  * Note that we currently only store the current values for
19  * Active, Capture and Focus windows currently.
20  * It might be necessary to store a pointer to the system message queue
21  * as well since windows 9x maintains per thread system message queues
22  */
23 typedef struct tagPERQUEUEDATA      
24 {
25   HWND    hWndFocus;              /* Focus window */
26   HWND    hWndActive;             /* Active window */
27   HWND    hWndCapture;            /* Capture window */
28   INT16     nCaptureHT;             /* Capture info (hit-test) */
29   ULONG     ulRefCount;             /* Reference count */
30   CRITICAL_SECTION cSection;        /* Critical section for thread safe access */
31 } PERQUEUEDATA;
32
33 /* Message queue */
34 typedef struct tagMESSAGEQUEUE
35 {
36   HQUEUE16  self;                   /* Handle to self (was: reserved) */
37   TEB*      teb;                    /* Thread owning queue */
38   HANDLE    server_queue;           /* Handle to server-side queue */
39
40   DWORD     magic;                  /* magic number should be QUEUE_MAGIC */
41   DWORD     lockCount;              /* reference counter */
42
43   DWORD     GetMessageTimeVal;      /* Value for GetMessageTime */
44   DWORD     GetMessagePosVal;       /* Value for GetMessagePos */
45   DWORD     GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
46
47   HANDLE16  hCurHook;               /* Current hook */
48   HANDLE16  hooks[WH_NB_HOOKS];     /* Task hooks list */
49
50   PERQUEUEDATA *pQData;             /* pointer to (shared) PERQUEUEDATA structure */
51   
52 } MESSAGEQUEUE;
53
54
55 #define QUEUE_MAGIC        0xD46E80AF
56
57 /* Per queue data management methods */
58 HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
59 HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
60 HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
61 HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
62 HWND PERQDATA_GetCaptureWnd( INT *hittest );
63 HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest );
64
65 /* Message queue management methods */
66 extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
67 extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
68 extern BOOL QUEUE_IsExitingQueue( HQUEUE16 hQueue );
69 extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue );
70 extern BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
71 extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
72 extern void QUEUE_CleanupWindow( HWND hwnd );
73
74 extern HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags );
75
76 #endif  /* __WINE_QUEUE_H */