ReactOS  0.4.14-dev-583-g2a1ba2c
msgtrace.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MSG_ENTRY
 
struct  _MSG_CACHE
 

Macros

#define COMPARE_CACHE(msg_chain)   compare_cache(&default_cache, __FILE__, __LINE__, msg_chain)
 
#define TRACE_CACHE()   trace_cache(&default_cache, __FILE__, __LINE__)
 
#define EMPTY_CACHE()   empty_message_cache(&default_cache);
 
#define RECORD_MESSAGE(...)   record_message(&default_cache, ##__VA_ARGS__);
 
#define COMPARE_CACHE_(cache, msg_chain)   compare_cache(cache, __FILE__, __LINE__, msg_chain)
 
#define TRACE_CACHE_(cache)   trace_cache(cache, __FILE__, __LINE__)
 
#define EMPTY_CACHE_(cache)   empty_message_cache(cache);
 
#define EXPECT_QUEUE_STATUS(expected, notexpected)
 

Typedefs

typedef enum _MSG_TYPE MSG_TYPE
 
typedef struct _MSG_ENTRY MSG_ENTRY
 
typedef struct _MSG_CACHE MSG_CACHE
 

Enumerations

enum  _MSG_TYPE {
  SENT, POST, HOOK, EVENT,
  SENT_RET, MARKER
}
 

Functions

void record_message (MSG_CACHE *cache, int iwnd, UINT message, MSG_TYPE type, int param1, int param2)
 
void compare_cache (MSG_CACHE *cache, const char *file, int line, MSG_ENTRY *msg_chain)
 
void trace_cache (MSG_CACHE *cache, const char *file, int line)
 
void empty_message_cache (MSG_CACHE *cache)
 
static BOOL IsDWmMsg (UINT msg)
 
static BOOL IseKeyMsg (UINT msg)
 

Variables

MSG_ENTRY empty_chain []
 
MSG_CACHE default_cache
 

Macro Definition Documentation

◆ COMPARE_CACHE

#define COMPARE_CACHE (   msg_chain)    compare_cache(&default_cache, __FILE__, __LINE__, msg_chain)

Definition at line 57 of file msgtrace.h.

◆ COMPARE_CACHE_

#define COMPARE_CACHE_ (   cache,
  msg_chain 
)    compare_cache(cache, __FILE__, __LINE__, msg_chain)

Definition at line 62 of file msgtrace.h.

◆ EMPTY_CACHE

#define EMPTY_CACHE ( )    empty_message_cache(&default_cache);

Definition at line 59 of file msgtrace.h.

◆ EMPTY_CACHE_

#define EMPTY_CACHE_ (   cache)    empty_message_cache(cache);

Definition at line 64 of file msgtrace.h.

◆ EXPECT_QUEUE_STATUS

#define EXPECT_QUEUE_STATUS (   expected,
  notexpected 
)
Value:
{ \
ok(((status) & (expected))== (expected),"wrong queue status. expected %li, and got %li\n", (DWORD)(expected), status); \
if(notexpected) \
ok((status & (notexpected))!=(notexpected), "wrong queue status. got non expected %li\n", (DWORD)(notexpected)); \
}
#define QS_ALLEVENTS
Definition: winuser.h:873
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetQueueStatus(_In_ UINT)
#define HIWORD(l)
Definition: typedefs.h:246
BOOL expected
Definition: store.c:2063
Definition: ps.c:97

Definition at line 66 of file msgtrace.h.

◆ RECORD_MESSAGE

#define RECORD_MESSAGE (   ...)    record_message(&default_cache, ##__VA_ARGS__);

Definition at line 60 of file msgtrace.h.

◆ TRACE_CACHE

#define TRACE_CACHE ( )    trace_cache(&default_cache, __FILE__, __LINE__)

Definition at line 58 of file msgtrace.h.

◆ TRACE_CACHE_

#define TRACE_CACHE_ (   cache)    trace_cache(cache, __FILE__, __LINE__)

Definition at line 63 of file msgtrace.h.

Typedef Documentation

◆ MSG_CACHE

◆ MSG_ENTRY

◆ MSG_TYPE

Enumeration Type Documentation

◆ _MSG_TYPE

Enumerator
SENT 
POST 
HOOK 
EVENT 
SENT_RET 
MARKER 

Definition at line 4 of file msgtrace.h.

5 {
6  SENT,
7  POST,
8  HOOK,
9  EVENT,
10  SENT_RET,
11  MARKER
12 } MSG_TYPE;
enum _MSG_TYPE MSG_TYPE
Definition: msgtrace.h:8
Definition: msgtrace.h:9
Definition: msgtrace.h:7
Definition: msgtrace.h:6

Function Documentation

◆ compare_cache()

void compare_cache ( MSG_CACHE cache,
const char file,
int  line,
MSG_ENTRY msg_chain 
)

Definition at line 143 of file msgtrace.c.

144 {
145  int i = 0;
146  char buffGot[100], buffExp[100];
147  BOOL got_error = FALSE;
148 
149  while(1)
150  {
151  BOOL same = !memcmp(&cache->message_cache[i],msg_chain, sizeof(MSG_ENTRY));
152 
153  sprintf_msg_entry(buffGot, &cache->message_cache[i]);
154  sprintf_msg_entry(buffExp, msg_chain);
155  ok_(file,line)(same,"%d: got %s, expected %s\n",i, buffGot, buffExp);
156 
157  if(!got_error && !same)
158  got_error = TRUE;
159 
160  if(msg_chain->msg !=0 || msg_chain->iwnd != 0)
161  msg_chain++;
162  else
163  {
164  if(i > cache->count)
165  break;
166  }
167  i++;
168  }
169 
170  if(got_error )
171  {
172  trace_(file,line)("The complete list of messages got is:\n");
174  }
175 
177 }
Definition: cache.c:48
#define trace_(file, line,...)
Definition: kmt_test.h:221
#define TRUE
Definition: types.h:120
UINT msg
Definition: msgtrace.h:17
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
Definition: msgtrace.h:14
void empty_message_cache(MSG_CACHE *cache)
Definition: msgtrace.c:83
void sprintf_msg_entry(char *buffer, MSG_ENTRY *msg)
Definition: msgtrace.c:88
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
void trace_cache(MSG_CACHE *cache, const char *file, int line)
Definition: msgtrace.c:130
Definition: parser.c:48
int iwnd
Definition: msgtrace.h:16
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ empty_message_cache()

void empty_message_cache ( MSG_CACHE cache)

Definition at line 83 of file msgtrace.c.

84 {
85  memset(cache, 0, sizeof(MSG_CACHE));
86 }
Definition: cache.c:48
#define memset(x, y, z)
Definition: compat.h:39

Referenced by compare_cache().

◆ IsDWmMsg()

static BOOL IsDWmMsg ( UINT  msg)
inlinestatic

Definition at line 39 of file msgtrace.h.

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 }
#define TRUE
Definition: types.h:120
#define WM_NCPAINT
Definition: winuser.h:1669
#define WM_PAINT
Definition: winuser.h:1602
#define msg(x)
Definition: auth_time.c:54
#define WM_ERASEBKGND
Definition: winuser.h:1607

Referenced by ClipTestProc(), DWPTestProc(), FlushMessages(), MSGChildProc2(), MSGChildProcMDI2(), MSGTestProc(), MSGTestProc2(), MSGTestProcMDI(), MSGTestProcMDI2(), OwnerTestProc(), RecordAndDispatch(), START_TEST(), SysParamsTestProc(), Thread1(), Thread2(), TmeTestProc(), and WndProc().

◆ IseKeyMsg()

static BOOL IseKeyMsg ( UINT  msg)
inlinestatic

◆ record_message()

void record_message ( MSG_CACHE cache,
int  iwnd,
UINT  message,
MSG_TYPE  type,
int  param1,
int  param2 
)

Definition at line 179 of file msgtrace.c.

180 {
181  if(cache->count >= 100)
182  {
183  return;
184  }
185 
186  /* do not report a post message a second time */
187  if(type == SENT &&
188  cache->last_post_message.iwnd == iwnd &&
189  cache->last_post_message.msg == message &&
190  cache->last_post_message.param1 == param1 &&
191  cache->last_post_message.param2 == param2)
192  {
193  memset(&cache->last_post_message, 0, sizeof(MSG_ENTRY));
194  return;
195  }
196 
197  cache->message_cache[cache->count].iwnd = iwnd;
198  cache->message_cache[cache->count].msg = message;
199  cache->message_cache[cache->count].type = type;
200  cache->message_cache[cache->count].param1 = param1;
201  cache->message_cache[cache->count].param2 = param2;
202 
203  if(cache->message_cache[cache->count].type == POST)
204  {
205  cache->last_post_message = cache->message_cache[cache->count];
206  }
207  else
208  {
209  memset(&cache->last_post_message, 0, sizeof(MSG_ENTRY));
210  }
211 
212  cache->count++;
213 }
Definition: cache.c:48
Definition: tftpd.h:59
Definition: msgtrace.h:14
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: msgtrace.h:7
Definition: msgtrace.h:6
#define memset(x, y, z)
Definition: compat.h:39

Referenced by FlushMessages(), TestProc(), and thread_proc().

◆ trace_cache()

void trace_cache ( MSG_CACHE cache,
const char file,
int  line 
)

Definition at line 130 of file msgtrace.c.

131 {
132  int i;
133  char buff[100];
134 
135  for (i=0; i < cache->count; i++)
136  {
137  sprintf_msg_entry(buff, &cache->message_cache[i]);
138  trace_(file,line)("%d: %s\n", i, buff);
139  }
140  trace_(file,line)("\n");
141 }
Definition: cache.c:48
#define trace_(file, line,...)
Definition: kmt_test.h:221
void sprintf_msg_entry(char *buffer, MSG_ENTRY *msg)
Definition: msgtrace.c:88
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: parser.c:48
static unsigned char buff[32768]
Definition: fatten.c:17
Definition: fci.c:126

Referenced by compare_cache().

Variable Documentation

◆ default_cache

MSG_CACHE default_cache

Definition at line 15 of file msgtrace.c.

◆ empty_chain