Hi Martin,
Original message from: Martin Wilck Martin.Wilck@fujitsu-siemens.com
I have taken a closer look at this code. I believe a very similar
approach
is possible for Winsock. However, there are a few problems:
Good to see you are a man of action, not just words!
typedef struct async_private
..
What do you think about this?
It would be cleaner to define a "general" async structure containing either a type-specific union or a pointer to type-specific data, and using void* for pointers. However, that would require even more changes in the async file I/O code, which I'd like
to
avoid at the moment.
i agree with you it would be better to use a union... i'll have a go at making a patch to do this. i'll probably understand the mess i've created in files/file.c more easily ;-)
Another difference is that the overlapped Winsock routines cause asynchronous success notification (i.e. calling the completion
routine or
signalling the lpOverlapped->hEvent) even if they are immediately successful, which seems not to be the case for asynchronous file I/O.
That would require a minor change in the check_async_list() routine.
Cool, go for it.
Please tell me your opinion!
Regards, Martin
i wrote a longer reply with a union definition in it, but accidently resized my Netscape window an lost it when the page reloaded :-( Could be about time to give up on this web-based email thing.
Mike
btw. in the patch in your other mail, you have:
-typedef struct _OVERLAPPED * LPWSAOVERLAPPED; typedef HANDLE WSAEVENT; + +typedef struct _WSAOVERLAPPED { + DWORD Internal; + DWORD InternalHigh; + DWORD Offset; + DWORD OffsetHigh; + WSAEVENT hEvent; +} WSAOVERLAPPED, *LPWSAOVERLAPPED; +
can you just use the following?
typedef OVERLAPPED WSAOVERLAPPED; typedef LPOVERLAPPED LPWSAOVERLAPPED; typedef HANDLE WSAEVENT;
or even #define...
------------------------------------------ mailto:Mike_McCormack@start.com.au ph +82 16 430 0425
__________________________________________________________________ Get your free Australian email account at http://www.Looksmart.com.au
On Fri, 9 Nov 2001, Mike McCormack wrote: [...]
btw. in the patch in your other mail, you have:
-typedef struct _OVERLAPPED * LPWSAOVERLAPPED; typedef HANDLE WSAEVENT;
+typedef struct _WSAOVERLAPPED {
- DWORD Internal;
- DWORD InternalHigh;
- DWORD Offset;
- DWORD OffsetHigh;
- WSAEVENT hEvent;
+} WSAOVERLAPPED, *LPWSAOVERLAPPED;
can you just use the following?
[...]
MS has two separate structures, one in winbase.h and one in winsock(2).h. So from a Winelib point of view we should have two separate structures too.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ Broadcast message : fin du monde dans cinq minutes, repentez vous !
On Thu, 8 Nov 2001, Francois Gouget wrote:
MS has two separate structures, one in winbase.h and one in winsock(2).h. So from a Winelib point of view we should have two separate structures too.
That's why I changed that. I don't think it causes actual problems, all elements can easily be casted into each other.
Thinking about my proposition to introduce a union in async_private, it may not be such a good idea after all. It would only be necessary if we were relying on the size of an async_private struct somewhere (e.g. using arrays of async_private's). This seems not to be the case, and thus we can take a similar approach as is taken with sock_addr structs. More reasonable than the union would be a header field indicating the type of the asycnc_private struct in question, but they can also be identified through the function pointers they use.
Martin
On Thu, 8 Nov 2001, Francois Gouget wrote:
On Fri, 9 Nov 2001, Mike McCormack wrote: [...]
btw. in the patch in your other mail, you have:
-typedef struct _OVERLAPPED * LPWSAOVERLAPPED; typedef HANDLE WSAEVENT;
+typedef struct _WSAOVERLAPPED {
- DWORD Internal;
- DWORD InternalHigh;
- DWORD Offset;
- DWORD OffsetHigh;
- WSAEVENT hEvent;
+} WSAOVERLAPPED, *LPWSAOVERLAPPED;
can you just use the following?
[...]
MS has two separate structures, one in winbase.h and one in winsock(2).h. So from a Winelib point of view we should have two separate structures too.
Actually I rechecked and MS only has separate types on Win16. For Win32 they use a #defines and typedefs! So it looks like the current Wine definitions are pretty much correct.
Sorry for the confusion.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ f u kn rd ts, ur wy 2 gky 4 ur wn gd.