RE: Win64 patch 3/6 (resend)

2006-07-25 Thread Ge van Geldorp
 From: Dmitry Timoshkov [mailto:[EMAIL PROTECTED] 
 
 Ge van Geldorp [EMAIL PROTECTED] 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.





Re: Win64 patch 3/6 (resend)

2006-07-25 Thread Dmitry Timoshkov

Ge van Geldorp [EMAIL PROTECTED] 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];
};

--
Dmitry.




RE: Win64 patch 3/6 (resend)

2006-07-25 Thread Ge van Geldorp
 From: Dmitry Timoshkov [mailto:[EMAIL PROTECTED] 
 
 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.





Re: Win64 patch 3/6 (resend)

2006-07-25 Thread Alexandre Julliard
Dmitry Timoshkov [EMAIL PROTECTED] writes:

 Ge van Geldorp [EMAIL PROTECTED] 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.

-- 
Alexandre Julliard
[EMAIL PROTECTED]




RE: Win64 patch 3/6 (resend)

2006-07-25 Thread Ge van Geldorp
 From: Alexandre Julliard [mailto:[EMAIL PROTECTED] 
 
 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 intmsg;/* 4 bytes */
/* 4 bytes padding */
unsigned long   wparam; /* 8 bytes */
unsigned long   lparam; /* 8 bytes */
int x;  /* 4 bytes */
int y;  /* 4 bytes */
unsigned inttime;   /* 4 bytes */
unsigned intinfo;   /* 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 intmsg;/* 4 bytes */
int x;  /* 4 bytes */
int y;  /* 4 bytes */
unsigned inttime;   /* 4 bytes */
unsigned intinfo;   /* 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.





Re: Win64 patch 3/6 (resend)

2006-07-25 Thread Alexandre Julliard
Ge van Geldorp [EMAIL PROTECTED] 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.

-- 
Alexandre Julliard
[EMAIL PROTECTED]




Re: Win64 patch 3/6 (resend)

2006-07-24 Thread Dmitry Timoshkov

Ge van Geldorp [EMAIL PROTECTED] 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.

--
Dmitry.