"Ge van Geldorp" ge@gse.nl wrote:
--- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -33,6 +33,9 @@ struct reply_header struct request_max_size { int pad[16]; +#ifdef _WIN64
- int pad64[10];
+#endif };
Why is this required? Is that due to asserts in server/request.c, open_master_socket() ? Is changing 'int' to 'long' a better fix?
Also probably the fix should go in server/protocol.def instead.
From: Dmitry Timoshkov [mailto:dmitry@codeweavers.com]
"Ge van Geldorp" ge@gse.nl wrote:
--- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -33,6 +33,9 @@ struct reply_header struct request_max_size { int pad[16]; +#ifdef _WIN64
- int pad64[10];
+#endif };
Why is this required? Is that due to asserts in server/request.c, open_master_socket() ?
Exactly.
Is changing 'int' to 'long' a better fix?
Perhaps. It would become
struct request_max_size { long pad[10]; int pad1[6]; };
then, which seems just as arbitrary.
Also probably the fix should go in server/protocol.def instead.
Yes, you're right. I had missed the "automatically generated" comment at the top of the include file. Will submit a new patch.
Gé van Geldorp.
"Ge van Geldorp" ge@gse.nl wrote:
Why is this required? Is that due to asserts in server/request.c, open_master_socket() ?
Exactly.
What exactly size is required then to avoid an assert?
Is changing 'int' to 'long' a better fix?
Perhaps. It would become
struct request_max_size { long pad[10]; int pad1[6]; };
then, which seems just as arbitrary.
No, I meant to make it irrespective to 32 or 64-bit compilation, i.e. look like:
struct request_max_size { long pad[16]; };
From: Dmitry Timoshkov [mailto:dmitry@codeweavers.com]
What exactly size is required then to avoid an assert?
This is the assert:
assert( sizeof(union generic_request) == sizeof(struct request_max_size) );
So the way the assert is written now "struct request_max_size" should have a size exactly equal to the largest of any of the individual request_* structures. Each of these request_* structures can contain a mix of 32-bit and 64-bit (on Wine64) members.
Perhaps. It would become
struct request_max_size { long pad[10]; int pad1[6]; };
then, which seems just as arbitrary.
No, I meant to make it irrespective to 32 or 64-bit compilation, i.e. look like:
struct request_max_size { long pad[16]; };
That won't work, it will be too large for Wine64 (the largest request_* is currently 104 bytes for Wine64, 64 bytes for Wine32) so the assert will still fail.
Gé van Geldorp.
"Dmitry Timoshkov" dmitry@codeweavers.com writes:
"Ge van Geldorp" ge@gse.nl wrote:
--- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -33,6 +33,9 @@ struct reply_header struct request_max_size { int pad[16]; +#ifdef _WIN64
- int pad64[10];
+#endif };
Why is this required? Is that due to asserts in server/request.c, open_master_socket() ? Is changing 'int' to 'long' a better fix?
The best way would be to fix the few offending requests so that we don't need to make every single request larger.
From: Alexandre Julliard [mailto:julliard@winehq.org]
The best way would be to fix the few offending requests so that we don't need to make every single request larger.
Not sure I understand what you mean. If I look at struct send_message_request, it's current 64-bit layout is:
struct send_message_request { struct request_header { int req; /* 4 bytes */ /* 4 bytes padding */ size_t request_size; /* 8 bytes */ size_t reply_size; /* 8 bytes */ } __header; thread_id_t id; /* 4 bytes */ int type; /* 4 bytes */ int flags; /* 4 bytes */ /* 4 bytes padding */ user_handle_t win; /* 8 bytes */ unsigned int msg; /* 4 bytes */ /* 4 bytes padding */ unsigned long wparam; /* 8 bytes */ unsigned long lparam; /* 8 bytes */ int x; /* 4 bytes */ int y; /* 4 bytes */ unsigned int time; /* 4 bytes */ unsigned int info; /* 4 bytes */ int timeout; /* 4 bytes */ /* 4 bytes padding */ void* callback; /* 8 bytes */ /* VARARG(data,bytes); */ }; Total 104 bytes.
Even if we rearrange the fields so minimum padding is required:
struct send_message_request { struct request_header { int req; /* 4 bytes */ /* 4 bytes padding */ size_t request_size; /* 8 bytes */ size_t reply_size; /* 8 bytes */ } __header; user_handle_t win; /* 8 bytes */ unsigned long wparam; /* 8 bytes */ unsigned long lparam; /* 8 bytes */ void* callback; /* 8 bytes */ thread_id_t id; /* 4 bytes */ int type; /* 4 bytes */ int flags; /* 4 bytes */ unsigned int msg; /* 4 bytes */ int x; /* 4 bytes */ int y; /* 4 bytes */ unsigned int time; /* 4 bytes */ unsigned int info; /* 4 bytes */ int timeout; /* 4 bytes */ /* 4 bytes padding */ /* VARARG(data,bytes); */ }; Total bytes required: 96.
The current request_max_size is
struct request_max_size { int pad[16]; };
which is only 64 bytes. I'm not sure what you want changed in request_send_message to make it fit in 64 bytes?
Ge van Geldorp.
"Ge van Geldorp" ge@gse.nl writes:
The current request_max_size is
struct request_max_size { int pad[16]; };
which is only 64 bytes. I'm not sure what you want changed in request_send_message to make it fit in 64 bytes?
Some fields like type and flags could be made short. The request/reply size can probably be ints. Other fields like callback, info, timeout are not needed for all message types, so they could be overloaded, or the request split in several requests.