ReactOS  0.4.14-dev-50-g13bb5e2
msgtrace.h
Go to the documentation of this file.
1 #ifndef APITESTS_MSGTRACE_H
2 #define APITESTS_MSGTRACE_H
3 
4 typedef enum _MSG_TYPE
5 {
6  SENT,
7  POST,
8  HOOK,
12 } MSG_TYPE;
13 
14 typedef struct _MSG_ENTRY
15 {
16  int iwnd;
19  int param1;
20  int param2;
21 } MSG_ENTRY;
22 
23 typedef struct _MSG_CACHE
24 {
27  int count;
28 } MSG_CACHE;
29 
30 extern MSG_ENTRY empty_chain[];
32 
33 void record_message(MSG_CACHE* cache, int iwnd, UINT message, MSG_TYPE type, int param1,int param2);
34 void compare_cache(MSG_CACHE* cache, const char* file, int line, MSG_ENTRY *msg_chain);
35 void trace_cache(MSG_CACHE* cache, const char* file, int line);
37 
38 /* filter messages that are affected by dwm */
39 static inline BOOL IsDWmMsg(UINT msg)
40 {
41  switch(msg)
42  {
43  case WM_NCPAINT:
44  case WM_ERASEBKGND:
45  case WM_PAINT:
46  case 0x031f: /*WM_DWMNCRENDERINGCHANGED*/
47  return TRUE;
48  }
49  return FALSE;
50 }
51 
52 static inline BOOL IseKeyMsg(UINT msg)
53 {
54  return (msg == WM_KEYUP || msg == WM_KEYDOWN);
55 }
56 
57 #define COMPARE_CACHE(msg_chain) compare_cache(&default_cache, __FILE__, __LINE__, msg_chain)
58 #define TRACE_CACHE() trace_cache(&default_cache, __FILE__, __LINE__)
59 #define EMPTY_CACHE() empty_message_cache(&default_cache);
60 #define RECORD_MESSAGE(...) record_message(&default_cache, ##__VA_ARGS__);
61 
62 #define COMPARE_CACHE_(cache, msg_chain) compare_cache(cache, __FILE__, __LINE__, msg_chain)
63 #define TRACE_CACHE_(cache) trace_cache(cache, __FILE__, __LINE__)
64 #define EMPTY_CACHE_(cache) empty_message_cache(cache);
65 
66 #define EXPECT_QUEUE_STATUS(expected, notexpected) \
67  { \
68  DWORD status = HIWORD(GetQueueStatus(QS_ALLEVENTS)); \
69  ok(((status) & (expected))== (expected),"wrong queue status. expected %li, and got %li\n", (DWORD)(expected), status); \
70  if(notexpected) \
71  ok((status & (notexpected))!=(notexpected), "wrong queue status. got non expected %li\n", (DWORD)(notexpected)); \
72  }
73 
74 #endif
Definition: cache.c:46
int count
Definition: msgtrace.h:27
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
UINT msg
Definition: msgtrace.h:17
Definition: msgtrace.h:14
void compare_cache(MSG_CACHE *cache, const char *file, int line, MSG_ENTRY *msg_chain)
Definition: msgtrace.c:143
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
_MSG_TYPE
Definition: msgtrace.h:4
int param2
Definition: msgtrace.h:20
#define WM_NCPAINT
Definition: winuser.h:1669
static BOOL IseKeyMsg(UINT msg)
Definition: msgtrace.h:52
struct _MSG_ENTRY MSG_ENTRY
unsigned int BOOL
Definition: ntddk_ex.h:94
MSG_TYPE type
Definition: msgtrace.h:18
enum _MSG_TYPE MSG_TYPE
#define WM_KEYDOWN
Definition: winuser.h:1697
Definition: parser.c:48
int param1
Definition: msgtrace.h:19
Definition: msgtrace.h:8
void trace_cache(MSG_CACHE *cache, const char *file, int line)
Definition: msgtrace.c:130
void record_message(MSG_CACHE *cache, int iwnd, UINT message, MSG_TYPE type, int param1, int param2)
Definition: msgtrace.c:179
#define WM_KEYUP
Definition: winuser.h:1698
Definition: msgtrace.h:9
void empty_message_cache(MSG_CACHE *cache)
Definition: msgtrace.c:83
#define WM_PAINT
Definition: winuser.h:1602
Definition: msgtrace.h:7
int iwnd
Definition: msgtrace.h:16
struct _MSG_CACHE MSG_CACHE
static BOOL IsDWmMsg(UINT msg)
Definition: msgtrace.h:39
MSG_CACHE default_cache
Definition: msgtrace.c:15
unsigned int UINT
Definition: ndis.h:50
Definition: msgtrace.h:6
#define msg(x)
Definition: auth_time.c:54
MSG_ENTRY last_post_message
Definition: msgtrace.h:25
MSG_ENTRY empty_chain[]
Definition: msgtrace.c:20
#define WM_ERASEBKGND
Definition: winuser.h:1607
MSG_ENTRY message_cache[100]
Definition: msgtrace.h:26
Definition: fci.c:126