server: Define an lparam_t type for message parameters that can hold all sorts of data.
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 9f32b30..28f8b22 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -22,6 +22,7 @@
typedef unsigned int thread_id_t;
typedef unsigned int data_size_t;
typedef unsigned int ioctl_code_t;
+typedef unsigned long lparam_t;
typedef unsigned __int64 file_pos_t;
struct request_header
@@ -171,8 +172,8 @@
struct callback_msg_data
{
void *callback;
- unsigned long data;
- unsigned long result;
+ lparam_t data;
+ lparam_t result;
};
struct winevent_msg_data
@@ -2449,8 +2450,8 @@
int flags;
user_handle_t win;
unsigned int msg;
- unsigned long wparam;
- unsigned long lparam;
+ lparam_t wparam;
+ lparam_t lparam;
timeout_t timeout;
/* VARARG(data,message_data); */
};
@@ -2492,9 +2493,9 @@
user_handle_t win;
unsigned int msg;
unsigned int time;
- unsigned long wparam;
- unsigned long lparam;
- unsigned long info;
+ lparam_t wparam;
+ lparam_t lparam;
+ lparam_t info;
int x;
int y;
};
@@ -2522,9 +2523,9 @@
user_handle_t win;
int type;
unsigned int msg;
- unsigned long wparam;
- unsigned long lparam;
- unsigned long info;
+ lparam_t wparam;
+ lparam_t lparam;
+ lparam_t info;
int x;
int y;
unsigned int time;
@@ -2539,7 +2540,7 @@
struct reply_message_request
{
struct request_header __header;
- unsigned long result;
+ lparam_t result;
int remove;
/* VARARG(data,bytes); */
};
@@ -2572,7 +2573,7 @@
struct get_message_reply_reply
{
struct reply_header __header;
- unsigned long result;
+ lparam_t result;
/* VARARG(data,bytes); */
};
@@ -2584,13 +2585,13 @@
user_handle_t win;
unsigned int msg;
unsigned int rate;
- unsigned long id;
- unsigned long lparam;
+ lparam_t id;
+ lparam_t lparam;
};
struct set_win_timer_reply
{
struct reply_header __header;
- unsigned long id;
+ lparam_t id;
};
@@ -2600,7 +2601,7 @@
struct request_header __header;
user_handle_t win;
unsigned int msg;
- unsigned long id;
+ lparam_t id;
};
struct kill_win_timer_reply
{
@@ -2857,10 +2858,10 @@
unsigned int id;
int is_unicode;
void* instance;
- unsigned long user_data;
+ lparam_t user_data;
int extra_offset;
data_size_t extra_size;
- unsigned long extra_value;
+ lparam_t extra_value;
};
struct set_window_info_reply
{
@@ -2869,8 +2870,8 @@
unsigned int old_ex_style;
unsigned int old_id;
void* old_instance;
- unsigned long old_user_data;
- unsigned long old_extra_value;
+ lparam_t old_user_data;
+ lparam_t old_extra_value;
};
#define SET_WIN_STYLE 0x01
#define SET_WIN_EXSTYLE 0x02
@@ -3692,7 +3693,7 @@
void* instance;
int extra_offset;
data_size_t extra_size;
- unsigned long extra_value;
+ lparam_t extra_value;
};
struct set_class_info_reply
{
@@ -3702,7 +3703,7 @@
int old_extra;
int old_win_extra;
void* old_instance;
- unsigned long old_extra_value;
+ lparam_t old_extra_value;
};
#define SET_CLASS_ATOM 0x0001
#define SET_CLASS_STYLE 0x0002
diff --git a/server/protocol.def b/server/protocol.def
index eba1b82..2d69c19 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -38,6 +38,7 @@
typedef unsigned int thread_id_t;
typedef unsigned int data_size_t;
typedef unsigned int ioctl_code_t;
+typedef unsigned long lparam_t;
typedef unsigned __int64 file_pos_t;
struct request_header
@@ -187,8 +188,8 @@
struct callback_msg_data
{
void *callback; /* callback function */
- unsigned long data; /* user data for callback */
- unsigned long result; /* message result */
+ lparam_t data; /* user data for callback */
+ lparam_t result; /* message result */
};
struct winevent_msg_data
@@ -1821,8 +1822,8 @@
int flags; /* message flags (see below) */
user_handle_t win; /* window handle */
unsigned int msg; /* message code */
- unsigned long wparam; /* parameters */
- unsigned long lparam; /* parameters */
+ lparam_t wparam; /* parameters */
+ lparam_t lparam; /* parameters */
timeout_t timeout; /* timeout for reply */
VARARG(data,message_data); /* message data for sent messages */
@END
@@ -1852,9 +1853,9 @@
user_handle_t win; /* window handle */
unsigned int msg; /* message code */
unsigned int time; /* message time */
- unsigned long wparam; /* parameters */
- unsigned long lparam; /* parameters */
- unsigned long info; /* extra info */
+ lparam_t wparam; /* parameters */
+ lparam_t lparam; /* parameters */
+ lparam_t info; /* extra info */
int x; /* x position */
int y; /* y position */
@END
@@ -1873,9 +1874,9 @@
user_handle_t win; /* window handle */
int type; /* message type */
unsigned int msg; /* message code */
- unsigned long wparam; /* parameters */
- unsigned long lparam; /* parameters */
- unsigned long info; /* extra info */
+ lparam_t wparam; /* parameters */
+ lparam_t lparam; /* parameters */
+ lparam_t info; /* extra info */
int x; /* x position */
int y; /* y position */
unsigned int time; /* message time */
@@ -1888,7 +1889,7 @@
/* Reply to a sent message */
@REQ(reply_message)
- unsigned long result; /* message result */
+ lparam_t result; /* message result */
int remove; /* should we remove the message? */
VARARG(data,bytes); /* message data for sent messages */
@END
@@ -1906,7 +1907,7 @@
@REQ(get_message_reply)
int cancel; /* cancel message if not ready? */
@REPLY
- unsigned long result; /* message result */
+ lparam_t result; /* message result */
VARARG(data,bytes); /* message data for sent messages */
@END
@@ -1916,10 +1917,10 @@
user_handle_t win; /* window handle */
unsigned int msg; /* message to post */
unsigned int rate; /* timer rate in ms */
- unsigned long id; /* timer id */
- unsigned long lparam; /* message lparam (callback proc) */
+ lparam_t id; /* timer id */
+ lparam_t lparam; /* message lparam (callback proc) */
@REPLY
- unsigned long id; /* timer id */
+ lparam_t id; /* timer id */
@END
@@ -1927,7 +1928,7 @@
@REQ(kill_win_timer)
user_handle_t win; /* window handle */
unsigned int msg; /* message to post */
- unsigned long id; /* timer id */
+ lparam_t id; /* timer id */
@END
@@ -2104,17 +2105,17 @@
unsigned int id; /* window id */
int is_unicode; /* ANSI or unicode */
void* instance; /* creator instance */
- unsigned long user_data; /* user-specific data */
+ lparam_t user_data; /* user-specific data */
int extra_offset; /* offset to set in extra bytes */
data_size_t extra_size; /* size to set in extra bytes */
- unsigned long extra_value; /* value to set in extra bytes */
+ lparam_t extra_value; /* value to set in extra bytes */
@REPLY
unsigned int old_style; /* old window style */
unsigned int old_ex_style; /* old window extended style */
unsigned int old_id; /* old window id */
void* old_instance; /* old creator instance */
- unsigned long old_user_data; /* old user-specific data */
- unsigned long old_extra_value; /* old value in extra bytes */
+ lparam_t old_user_data; /* old user-specific data */
+ lparam_t old_extra_value; /* old value in extra bytes */
@END
#define SET_WIN_STYLE 0x01
#define SET_WIN_EXSTYLE 0x02
@@ -2667,14 +2668,14 @@
void* instance; /* module instance */
int extra_offset; /* offset to set in extra bytes */
data_size_t extra_size; /* size to set in extra bytes */
- unsigned long extra_value; /* value to set in extra bytes */
+ lparam_t extra_value; /* value to set in extra bytes */
@REPLY
atom_t old_atom; /* previous class atom */
unsigned int old_style; /* previous class style */
int old_extra; /* previous number of class extra bytes */
int old_win_extra; /* previous number of window extra bytes */
void* old_instance; /* previous module instance */
- unsigned long old_extra_value; /* old value in extra bytes */
+ lparam_t old_extra_value; /* old value in extra bytes */
@END
#define SET_CLASS_ATOM 0x0001
#define SET_CLASS_STYLE 0x0002
diff --git a/server/queue.c b/server/queue.c
index b1f82dd..40ecb6b 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -57,7 +57,7 @@
struct msg_queue *receiver; /* receiver queue */
int replied; /* has it been replied to? */
unsigned int error; /* error code to pass back to sender */
- unsigned long result; /* reply result */
+ lparam_t result; /* reply result */
struct message *callback_msg; /* message to queue for callback */
void *data; /* message reply data */
unsigned int data_size; /* size of message reply data */
@@ -70,9 +70,9 @@
enum message_type type; /* message type */
user_handle_t win; /* window handle */
unsigned int msg; /* message code */
- unsigned long wparam; /* parameters */
- unsigned long lparam; /* parameters */
- unsigned long info; /* extra info */
+ lparam_t wparam; /* parameters */
+ lparam_t lparam; /* parameters */
+ lparam_t info; /* extra info */
int x; /* x position */
int y; /* y position */
unsigned int time; /* message time */
@@ -89,8 +89,8 @@
unsigned int rate; /* timer rate in ms */
user_handle_t win; /* window handle */
unsigned int msg; /* message to post */
- unsigned long id; /* timer id */
- unsigned long lparam; /* lparam for message */
+ lparam_t id; /* timer id */
+ lparam_t lparam; /* lparam for message */
};
struct thread_input
@@ -127,7 +127,7 @@
struct message_result *recv_result; /* stack of received messages waiting for result */
struct list pending_timers; /* list of pending timers */
struct list expired_timers; /* list of expired timers */
- unsigned long next_timer_id; /* id for the next timer with a 0 window */
+ lparam_t next_timer_id; /* id for the next timer with a 0 window */
struct timeout_user *timeout; /* timeout for next timer to expire */
struct thread_input *input; /* thread input descriptor */
struct hook_table *hooks; /* hook table */
@@ -442,8 +442,7 @@
}
/* store the message result in the appropriate structure */
-static void store_message_result( struct message_result *res, unsigned long result,
- unsigned int error )
+static void store_message_result( struct message_result *res, lparam_t result, unsigned int error )
{
res->result = result;
res->error = error;
@@ -631,7 +630,7 @@
}
/* set the result of the current received message */
-static void reply_message( struct msg_queue *queue, unsigned long result,
+static void reply_message( struct msg_queue *queue, lparam_t result,
unsigned int error, int remove, const void *data, data_size_t len )
{
struct message_result *res = queue->recv_result;
@@ -1009,7 +1008,7 @@
/* find a timer from its window and id */
static struct timer *find_timer( struct msg_queue *queue, user_handle_t win,
- unsigned int msg, unsigned long id )
+ unsigned int msg, lparam_t id )
{
struct list *ptr;
@@ -1481,8 +1480,7 @@
}
/* post a message to a window; used by socket handling */
-void post_message( user_handle_t win, unsigned int message,
- unsigned long wparam, unsigned long lparam )
+void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lparam_t lparam )
{
struct message *msg;
struct thread *thread = get_window_thread( win );
@@ -1927,7 +1925,7 @@
struct msg_queue *queue;
struct thread *thread = NULL;
user_handle_t win = 0;
- unsigned long id = req->id;
+ lparam_t id = req->id;
if (req->win)
{
diff --git a/server/sock.c b/server/sock.c
index bf67d73..baaa9df 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -278,8 +278,8 @@
int event = event_bitorder[i];
if (sock->pmask & (1 << event))
{
- unsigned int lparam = (1 << event) | (sock->errors[event] << 16);
- post_message( sock->window, sock->message, (unsigned long)sock->wparam, lparam );
+ lparam_t lparam = (1 << event) | (sock->errors[event] << 16);
+ post_message( sock->window, sock->message, sock->wparam, lparam );
}
}
sock->pmask = 0;
diff --git a/server/user.h b/server/user.h
index b12fccb..72d08e6 100644
--- a/server/user.h
+++ b/server/user.h
@@ -92,7 +92,7 @@
extern int attach_thread_input( struct thread *thread_from, struct thread *thread_to );
extern void detach_thread_input( struct thread *thread_from );
extern void post_message( user_handle_t win, unsigned int message,
- unsigned long wparam, unsigned long lparam );
+ lparam_t wparam, lparam_t lparam );
extern void post_win_event( struct thread *thread, unsigned int event,
user_handle_t win, unsigned int object_id,
unsigned int child_id, void *proc,
diff --git a/server/window.c b/server/window.c
index da97a8e..2fa6164 100644
--- a/server/window.c
+++ b/server/window.c
@@ -83,7 +83,7 @@
unsigned int color_key; /* color key for a layered window */
unsigned int alpha; /* alpha value for a layered window */
unsigned int layered_flags; /* flags for a layered window */
- unsigned long user_data; /* user-specific data */
+ lparam_t user_data; /* user-specific data */
WCHAR *text; /* window caption text */
unsigned int paint_flags; /* various painting flags */
int prop_inuse; /* number of in-use window properties */
diff --git a/tools/make_requests b/tools/make_requests
index 76be7b2..227ac27 100755
--- a/tools/make_requests
+++ b/tools/make_requests
@@ -37,6 +37,7 @@
"user_handle_t" => "%08x",
"process_id_t" => "%04x",
"thread_id_t" => "%04x",
+ "lparam_t" => "%lx",
"timeout_t" => "&dump_timeout",
"rectangle_t" => "&dump_rectangle",
"char_info_t" => "&dump_char_info",